获取header

master
tpingzhang 5 years ago
parent 8e766a4fe9
commit 72b4a78a87

@ -252,3 +252,19 @@ function re_msg($code=200,$msg='',$data=[])
echo base64_encode(json_encode($ret));
exit();
}
if (!function_exists('getallheaders'))
{
function getallheaders()
{
$headers = array();
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}

Loading…
Cancel
Save