zrong 发表于 2017-3-22 11:34:04

PHP $_SERVER变量的使用

  $_SERVER 变量的使用
  PHP编程中经常需要用到一些服务器的一些资料,可以通过$_SERVER来获取

print_r($_SERVER);
   打印结果:
   => */*
=> zh-cn
=> gzip, deflate
=> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
=> localhost
=> Keep-Alive
=> PHPSESSID=e19d7b71bc8548f3ae72ecb78d35269d
=> C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_11\bin;C:\Program Files\Java\jdk1.6.0_11\jre\bin;C:\Program Files\TortoiseSVN\bin
=> C:\WINDOWS
=> C:\WINDOWS\system32\cmd.exe
=> .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
=> C:\WINDOWS
=>

Apache/2.2.8 (Win32) PHP/5.2.6 Server at localhost Port 80  
=> Apache/2.2.8 (Win32) PHP/5.2.6
=> localhost
=> 127.0.0.1
=> 80
=> 127.0.0.1
=> D:/AppServ2510/www
=> theemail@sohu.com
=> D:/AppServ2510/www/qthinker/weijingtai/content.php
=> 2278
=> CGI/1.1
=> HTTP/1.1
=> GET
=>
=> /qthinker/weijingtai/content.php
=> /qthinker/weijingtai/content.php
=> /qthinker/weijingtai/content.php
=> 1350907194
页: [1]
查看完整版本: PHP $_SERVER变量的使用