Home  >  Article  >  php教程  >  傻傻分不清楚的php脚本路径,傻傻不清楚php脚本

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

WBOY
WBOYOriginal
2016-06-13 08:54:561176browse

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

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

  先贴上代码:

<?<span>php
</span><span>echo</span> <span>$_SERVER</span>['PHP_SELF'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>__FILE__</span><span>;
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['SCRIPT_FILENAME'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['REMOTE_ADDR'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['QUERY_STRING'<span>];
</span><span>echo</span> "<hr/>";

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

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

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

 

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