Home  >  Article  >  Backend Development  >  PHP预定义常量FILE

PHP预定义常量FILE

WBOY
WBOYOriginal
2016-06-23 13:42:07964browse

    目录结构:

    --F:\website\webgis\index.php


  测试代码:index.php

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

  输出结果:

测试输出__FILE__
F:\website\webgis\index.php
F:\website\webgis

  

  总结:__FILE__输出当前文件的路径。include(index.php)情况下,输出的路径也是F:\website\webgis\index.php。

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