nginx下用getallheaders

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;
}
}

posted on 2019-01-21 17:23  陈可  阅读(322)  评论(0编辑  收藏  举报

导航