$headers = getallheaders(); foreach ($headers as $name = $content) {echo "headers[$name] = $content br \n";}
The functions header(), setcookie() and the session functions need to add headers to the output stream. But headers can only be sent before all other content, check if your script is sending headers after having already sent content.