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

PHP predefined constant __FILE__

WBOY
Release: 2016-08-08 09:31:36
Original
1148 people have browsed it

Directory structure:

--F:websitewebgisindex.php

Test code: index.php

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

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.

Related labels:
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