Home  >  Article  >  Backend Development  >  What does __FILE__ mean in php

What does __FILE__ mean in php

王林
王林Original
2021-07-07 14:14:426337browse

__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!

Statement:
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
Previous article:How to turn off php cacheNext article:How to turn off php cache