<?php
echo "POST: \n".json_encode($_POST)."\n";
echo "GET: \n".json_encode($_GET)."\n";
echo "COOKIE: \n".json_encode($_COOKIE)."\n";
echo "HEADERS:\n";
function getRequestHeaders() {
    $headers = array();
    foreach($_SERVER as $key => $value) {
        if (substr($key, 0, 5) <> 'HTTP_') {
            continue;
        }
        $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
        $headers[$header] = $value;
    }
    return $headers;
}

$headers = getRequestHeaders();

foreach ($headers as $header => $value) {
    echo "$header: $value <br />\n";
}