Skip to content

Instantly share code, notes, and snippets.

@andrei-coelho
Created February 11, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrei-coelho/8e2980bcd2af53f82247e5637a30cd59 to your computer and use it in GitHub Desktop.
Save andrei-coelho/8e2980bcd2af53f82247e5637a30cd59 to your computer and use it in GitHub Desktop.
to get headers sent
<?php
$result = "";
foreach($_SERVER as $K => $V){
$a = explode('_' , $K);
if(array_shift($a) == 'HTTP'){
array_walk($a, function(&$v){
$v = ucfirst(strtolower($v));
});
$result .= join('-',$a).": ".$V."<br>";
}
}
echo $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment