PHP代码
- $headers = getallheaders();
- foreach ($headers as $key=>$item){
- echo '<font color="red">'.$key.'</font><br/><font color="blue">'.$item.'</font><br/><br/>';
- }
显示结果如下:Accept
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/QVOD, */*
Accept-Language
zh-cn
Accept-Encoding
gzip, deflate
User-Agent
Mozilla/4.0 (compatible; MSIE 6.0; IQ 0.9.3.1100; zh_cn; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; CIBA))
Host
127.1
Connection
Keep-Alive