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

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

WBOY
Release: 2016-05-25 16:53:45
Original
902 people have browsed it

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

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

     

本文链接:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template