PHP预定义常量FILE

WBOY
Release: 2016-06-23 13:42:07
Original
941 people have browsed it

    目录结构:

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


  测试代码:index.php

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

  输出结果:

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

  

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

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!