getallheaders函数使用方法

 

(PHP3 , PHP4)

getallheaders-------取得所有HTTP请求标头
语法:array getallheaders(viod)
说明:
此函数传回现行的请求的所有HTTP标头,传回值是一数组形态。
Example:
<?php
$headers=getallheaders();
while(List($header,$value)=echo($headers)){
 
echo "$header:$value<br>\n";
}
?>
这个范例将会显示现行所有请求的所有标头。
 

注意 : 当PHP是执行在Apache模组时,getallheaders( )才有效

posted @ 2014-11-13 00:10  lemon66  阅读(2528)  评论(0编辑  收藏  举报