php - apache_request_headers

Description

array apache_request_headers ( void )

Fetches all HTTP requests from the current request.

This function is only supported when PHP is installed as an Apache module.

Return Values

An associative array of all the HTTP headers in the current request, or FALSE on failure.

Examples

Example 200. apache_request_headers() example

$headers = apache_request_headers();

foreach (
$headers as $header => $value) {
echo
"$header: $value
\n"
;
}

The above example will output something similar to:

Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: www.example.com
Connection: Keep-Alive 

No comments:

Post a Comment