Array of HTTP Request Headers in PHP
You can get all HTTP request headers as an array (does not work on all servers). This is done using the following function:
<?php
$arr = getallheaders();
var_dump($arr);
?>
Get the array of headers. Loop through this array and output the header names and their values to the screen.