//获取请求头信息接口 function getheaders() { $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; }
原文地址:https://www.cnblogs.com/zhangjian816/p/10330029.html
时间: 2024-11-04 03:34:10