Skip to content

Instantly share code, notes, and snippets.

@Foxy79
Created February 24, 2016 11:29
Show Gist options
  • Save Foxy79/c2d272e7ed28b78601f9 to your computer and use it in GitHub Desktop.
Save Foxy79/c2d272e7ed28b78601f9 to your computer and use it in GitHub Desktop.
<?php
if (!function_exists('getallheaders')) {
function getallheaders() {
$headers = '';
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