nginx下用getallheaders

来源:csdn博客 分类: 文章浏览史 发布时间:2021-11-20 16:05:19 最后更新:2021-11-20 浏览:295
转载声明:
本文为摘录自“csdn博客”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2021-11-20 16:05:19
if (!function_exists('getallheaders')) {
function getallheaders()
{
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}

转载于:https://www.cnblogs.com/chenkg/p/10299910.html

php技术微信