Chinaunix首页 | 论坛 | 博客
  • 博客访问: 18681135
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-04-18 09:15:14

$array = array(
               "remote_addr",
               "document_root",
               "gateway_interface",
               "server_software",
               "server_name",
               "server_protocol",
               "server_port",
               "server_admin",
               "server_signature",
               "request_method",
               "request_uri",
               "path_info",
               "path_translated",
               "script_name",
               "script_filename",
               "query_string",
               "remote_host",
               "remote_addr",
               "remote_user",
               "remote_ident",
               "content_type",
               "content_length",
               "http_accept",
               "http_accept_charset",
               "http_accept_language",
               "http_encoding",
               "http_user_agent",
               "http_connection",
               "http_host",
               "http_referer",
               "auth_type"
              );

echo

;
echo ;
echo ;
echo ;

$count = count($array);
for($i=0;$i<$count;$i++){
   $value = getenv($array[$i]);
   if($value){
      echo "";
   }
//下面的语句也可以哦
//   if(isset($$array[$i])){
//      echo "";
//   }
}

echo
cgi environment variables
namevalue
$array[$i]" . $value . "
$array[$i]" . $$array[$i] . "
;
echo
;
?>

阅读(1352) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~