GET/POST Spew In PHP with print_r()
Just a quick piece of PHP code to spew anything after the page URL, EG ?foo=bar&foo2=bar2. I find it useful to use from time to time where I uber fuck up a form element and can't be bothered to look back over my code to fix it. You could use $_GET and $_POST but using the $_REQUEST variable covers them both.
print_r($_REQUEST);
You can use the print_r (print recursively) on any array - so it works on superglobals like $_SERVER and $_COOKIE, which can be sometimes useful for debugging.
The $_COOKIE superglobal especially awesome as it lets you see any cookies that the script you're running the code from has access to, and their values.
You can also use it with your own arrays:
$pie = array('foo' => 'bar','one' => 'two');
print_r($pie); Output
Array(
[foo] => bar
[one] => two
)