PHP $_SERVER变量的使用

$_SERVER 变量的使用

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

print_r($_SERVER);
 

打印结果:

 

[HTTP_ACCEPT] => */* [HTTP_ACCEPT_LANGUAGE] => zh-cn [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0) [HTTP_HOST] => localhost [HTTP_CONNECTION] => Keep-Alive [HTTP_COOKIE] => PHPSESSID=e19d7b71bc8548f3ae72ecb78d35269d [PATH] => 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 [SystemRoot] => C:\WINDOWS [COMSPEC] => C:\WINDOWS\system32\cmd.exe [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH [WINDIR] => C:\WINDOWS [SERVER_SIGNATURE] =>

Apache/2.2.8 (Win32) PHP/5.2.6 Server at localhost Port 80

[SERVER_SOFTWARE] => Apache/2.2.8 (Win32) PHP/5.2.6 [SERVER_NAME] => localhost [SERVER_ADDR] => 127.0.0.1 [SERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => D:/AppServ2510/www [SERVER_ADMIN] => theemail@sohu.com [SCRIPT_FILENAME] => D:/AppServ2510/www/qthinker/weijingtai/content.php [REMOTE_PORT] => 2278 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /qthinker/weijingtai/content.php [SCRIPT_NAME] => /qthinker/weijingtai/content.php [PHP_SELF] => /qthinker/weijingtai/content.php [REQUEST_TIME] => 1350907194

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值