apache_request_headers — Retrieve All HTTP Request Header Information in PHP
The apache_request_headers function in PHP returns an associative array of all HTTP request headers for the current request, requires no parameters, and returns FALSE on failure, with an example demonstrating how to iterate and display each header and its value.
apache_request_headers is a PHP function that returns an associative array containing all HTTP request header information for the current request. It takes no parameters and returns FALSE on failure.
Parameters : None.
Return value : An array of all request headers, or FALSE if the operation fails.
Example :
$value) {
echo "$header: $value
\n";
}
// Sample output:
// Accept: */*
// Accept-Language: en-us
// Accept-Encoding: gzip, deflate
// User-Agent: Mozilla/4.0
// Host: www.example.com
// Connection: Keep-Alive
?>Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.