getHeaders() code example
Example 1: getallheaders()
it could be useful if you using nginx instead of apache
$value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}
?>
Example 2: getallheaders()
There's a polyfill for this that can be downloaded or installed via composer:
https://github.com/ralouphie/getallheaders