Skip to content

Instantly share code, notes, and snippets.

@TheLastCicada
Last active January 10, 2017 01:10
Show Gist options
  • Save TheLastCicada/e54fa8e1c13d5ad5bfdd8a73f07598e6 to your computer and use it in GitHub Desktop.
Save TheLastCicada/e54fa8e1c13d5ad5bfdd8a73f07598e6 to your computer and use it in GitHub Desktop.
Print Request HTTP Headers with PHP
<ul>
<?php
foreach($_SERVER as $h=>$v)
if(ereg('HTTP_(.+)',$h,$hp))
echo "<li>$h = $v</li>\n";
header('Content-type: text/html');
echo "<br> The current directory is: " . getcwd() . "\n";
?>
</ul>
<!--Original code at https://snippets.aktagon.com/snippets/117-how-to-print-all-http-headers-with-php-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment