闲话就不说了,还是直接提出今天的问题,准确的说,对多个相似的 有关当前脚本信息的全局变量常量的区分。
先贴上代码:
<?<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为根目录。
现在一看,原来仔细看过的还真有点丈二和尚摸不着头脑。
贴出结果,不用多做解释,相信很多人也一目了然了。