Created
December 31, 2013 19:04
-
-
Save zabbarob/8200929 to your computer and use it in GitHub Desktop.
Web page that prints out the contents of most predefined variables in PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header('Content-Type: text/plain'); | |
function echoAll($a, $n) { | |
if ($a) { | |
echo join(PHP_EOL, array_map(function($key) use ($a, $n) { | |
return $n . "['$key'] = '$a[$key]';"; | |
}, array_keys($a))), PHP_EOL; | |
} | |
} | |
echoAll($_SERVER, '$_SERVER'); | |
echoAll($_GET, '$_GET'); | |
echoAll($_POST, '$_POST'); | |
echoAll($_COOKIE, '$_COOKIE'); | |
echoAll($_FILES, '$_FILES'); | |
echoAll($_REQUEST, '$_REQUEST'); | |
echoAll($_SESSION, '$_SESSION'); | |
echoAll($_ENV, '$_ENV'); | |
exit('DEBUGGING'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment