Last active
December 16, 2015 07:19
-
-
Save chernjie/5397453 to your computer and use it in GitHub Desktop.
apache_request_headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print_r(apache_request_headers()); | |
foreach ($_SERVER as $key => $val) | |
{ | |
if (sscanf($key, 'HTTP_%s', $header) === 1) | |
{ | |
// take SOME_HEADER and turn it into Some-Header | |
$header = str_replace('_', ' ', strtolower($header)); | |
$header = str_replace(' ', '-', ucwords($header)); | |
echo $key . ' ' . $header . ' ' . $_SERVER[$key] . "\n"; | |
} | |
} |
Author
chernjie
commented
Apr 16, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment