Bookmark and Share

Lee's 程序人生

HTML CSS Javascript XML AJAX ATLAS C# C++ 数据结构 软件工程 设计模式 asp.net Java 数字图象处理 Sql 数据库
  博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

$_SERVER超级变量值

Posted on 2008-12-27 20:41  analyzer  阅读(209)  评论(0编辑  收藏  举报

用for循环出$_SERVER超级变量的值:
 

 
  1. <?php   
  2. foreach($_SERVER as $names =>$values) {   
  3.     echo '$_SERVER["''.$names.'"']='.$values.'<br/>';   
  4. }   
  5. ?>  

结果:
$_SERVER[color=#0000ff]['HTTP_ACCEPT']=*/*
$_SERVER['HTTP_ACCEPT_LANGUAGE']=zh-cn
$_SERVER['HTTP_UA_CPU']=x86
$_SERVER['HTTP_ACCEPT_ENCODING']=gzip, deflate
$_SERVER['HTTP_USER_AGENT']=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Mozilla/4.0(Compatible Mozilla/4.0(Compatible-EmbeddedWB 14.59 http://bsalsa.com/ EmbeddedWB- 14.59 from: http://bsalsa.com/ ; .NET CLR 1.1.4322)
$_SERVER['HTTP_HOST']=localhost
$_SERVER['HTTP_CONNECTION']=Keep-Alive
$_SERVER['HTTP_COOKIE']=PHPSESSID=ic8nrqpns9kt3spdg0h99ofkc1
$_SERVER['PATH']=c:"windows"system32;c:"windows;c:"windows"system32"WBEM;c:"sybase"bin;c:"sybase"dll;D:"MPlayer
$_SERVER['SystemRoot']=C:"WINDOWS
$_SERVER['COMSPEC']=C:"WINDOWS"system32"cmd.exe
$_SERVER['PATHEXT']=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
$_SERVER['WINDIR']=C:"WINDOWS
$_SERVER['SERVER_SIGNATURE']=
$_SERVER['SERVER_SOFTWARE']=Apache/2.2.8 (Win32) PHP/5.2.5
$_SERVER['SERVER_NAME']=localhost
$_SERVER['SERVER_ADDR']=127.0.0.1
$_SERVER['SERVER_PORT']=80
$_SERVER['REMOTE_ADDR']=127.0.0.1
$_SERVER['DOCUMENT_ROOT']=D:/SERVER/wwwroot
$_SERVER['SERVER_ADMIN']=0758jian@163.com
$_SERVER['SCRIPT_FILENAME']=D:/SERVER/wwwroot/demo/ip.php
$_SERVER['REMOTE_PORT']=1379
$_SERVER['GATEWAY_INTERFACE']=CGI/1.1
$_SERVER['SERVER_PROTOCOL']=HTTP/1.1
$_SERVER['REQUEST_METHOD']=GET
$_SERVER['QUERY_STRING']=
$_SERVER['REQUEST_URI']=/demo/ip.php
$_SERVER['SCRIPT_NAME']=/demo/ip.php
$_SERVER['PHP_SELF']=/demo/ip.php
$_SERVER['REQUEST_TIME']=1226885717

我要啦免费统计