Skip to content

Instantly share code, notes, and snippets.

@chrisvaughn
Created December 17, 2012 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvaughn/4317712 to your computer and use it in GitHub Desktop.
Save chrisvaughn/4317712 to your computer and use it in GitHub Desktop.
protected function getallheaders()
{
$headers = array();
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment