Home > Article > Backend Development > What does __FILE__ mean in php
__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.
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!