Register now and start sharing your code snippets.
-->

How to print all HTTP headers with PHP

PHP posted 10 months ago by christian

   1  <ul>
   2   <?php
   3     foreach($_SERVER as $h=>$v)
   4       if(ereg('HTTP_(.+)',$h,$hp))
   5         echo "<li>$h = $v</li>\n";
   6     header('Content-type: text/html');
   7    ?>
   8  </ul>

Tagged php, http, headers, request