Home  >  Article  >  Backend Development  >  I want to read the request header directly, what should I do? _PHP Tutorial

I want to read the request header directly, what should I do? _PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:53:18746browse

If you use module mode to run PHP, the function getallheaders() can meet your requirements. Therefore, the following program can display the HTTP variable values ​​​​of all your requests:
$headers = getallheaders();
for(reset($headers); $key = key($headers); next($headers) )
{ echo "headers[$key] = ".$headers[$key]."
n"; }

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632415.htmlTechArticleIf you use module mode to run PHP, the function getallheaders() can meet your requirements. Therefore, the following program can display the HTTP variable values ​​​​of all your requests: $headers = getallheader...
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