What does __FILE__ mean in php

王林
Release: 2023-03-11 10:14:01
Original
6421 people have browsed it

__FILE__ in php is a magic constant that returns the full path and file name of the currently executing PHP script. Since PHP version 4.0.2, it always contains an absolute path.

What does __FILE__ mean in php

The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.

The full path and file name of the file. If used within an included file, returns the name of the included file. Since PHP 4.0.2, __FILE__ always contains an absolute path (or the resolved absolute path in the case of a symbolic link), while versions before that sometimes contained a relative path.

__FILE__: Known as PHP magic constant, returns the complete path and file name of the currently executed PHP script, including an absolute path

dirname(__FILE__) generally returns the current directory where the file is located. A directory structure for the system root directory.

Recommended related video tutorials: php video tutorial

The above is the detailed content of What does __FILE__ mean in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template