Home >Backend Development >PHP Tutorial >PHP predefined constant __FILE__

PHP predefined constant __FILE__

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-08 09:31:361154browse

Directory structure:

--F:websitewebgisindex.php

Test code: index.php

echo "<br>测试输出__FILE__";
echo "<br>".__FILE__;
echo "<br>".dirname(__FILE__);

Output result:

Test output__FILE__
F:websitewebgisindex.php
F:websitewebgis

Summary: __FILE__ outputs the path of the current file. In the case of include(index.php), the output path is also F:websitewebgisindex.php.

The above introduces the PHP predefined constant __FILE__, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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