时间:2021-07-01 10:21:17 帮助过:0人阅读
function emu_getallheaders() { foreach ($_SERVER as $name => $value) { if (strncmp($name, 'HTTP_', 5) === 0) { $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); $headers[$name] = $value; } else if ($name == "CONTENT_TYPE") { $headers["Content-Type"] = $value; } else if ($name == "CONTENT_LENGTH") { $headers["Content-Length"] = $value; } } return $headers; }
可以在任意WEB服务器上使用.