Home >php教程 >php手册 >我要直接读取请求的信息头,我要怎么做?

我要直接读取请求的信息头,我要怎么做?

WBOY
WBOYOriginal
2016-05-25 16:53:45899browse

如果你使用模块方式运行PHP,函数getallheaders()可以达到你的要求。因此照下面的程序可以显示你所有请求的HTTP变量值:

$headers = getallheaders(); 
for(reset($headers); $key = key($headers); next($headers))  
{
    echo "headers[$key] = ".$headers[$key]."\n";
}

     

本文链接:

收藏随意^^请保留教程地址.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn