Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Web page that prints out the contents of most predefined variables in PHP.
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