it could be useful if you using nginx instead of apache
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;
}
}
getallheaders
(PHP 4, PHP 5)
getallheaders — 모든 HTTP 요청 헤더를 가져옵니다.
설명
array getallheaders
( void
)
getallheaders()는 apache_request_headers()의 별칭입니다. 현재 요청의 모든 HTTP 헤더를 연합 배열로 반환합니다. 이 함수의 작동에 대한 정보는 apache_request_headers() 문서를 읽어보십시오.
Note: PHP 4.3.0에서, getallheaders()는 apache_request_headers()의 별칭이 되었습니다. 정확히는 이름이 바뀌었습니다. 이는 이 함수가 Apache 모듈로 컴파일했을 때만 작동하기 때문입니다.
Note: PHP 4.3.3부터 이 함수를 넷스케이프/iPlanet/SunONE 웹서버의 NSAPI 서버 모듈에서도 사용할 수 있습니다.
getallheaders
joyview at gmail dot com
06-Jul-2008 08:52
06-Jul-2008 08:52
lorro at lorro dot hu
19-Apr-2005 06:25
19-Apr-2005 06:25
Beware that RFC2616 (HTTP/1.1) defines header fields as case-insensitive entities. Therefore, array keys of getallheaders() should be converted first to lower- or uppercase and processed such.
