Home > Backend Development > PHP Tutorial > 傻傻分不清楚的php脚本路径

傻傻分不清楚的php脚本路径

WBOY
Release: 2016-06-23 13:27:03
Original
1062 people have browsed it

   闲话就不说了,还是直接提出今天的问题,准确的说,对多个相似的 有关当前脚本信息的全局变量常量的区分。

  先贴上代码:

<?phpecho $_SERVER['PHP_SELF'];echo "<hr/>";echo __FILE__;echo "<hr/>";echo $_SERVER['SCRIPT_FILENAME'];echo "<hr/>";echo $_SERVER['REMOTE_ADDR'];echo "<hr/>";echo $_SERVER['QUERY_STRING'];echo "<hr/>";
Copy after login

  浏览器中的地址为http://localhost/test/test4.php?a=3  localhost为根目录。

  现在一看,原来仔细看过的还真有点丈二和尚摸不着头脑。

      贴出结果,不用多做解释,相信很多人也一目了然了。

 

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