Page 1 of 1
How would I display all the variables on a current page
Posted: Fri Nov 25, 2005 5:36 pm
by vwilsonjr
I want to display all the variables, session, cookies, forms ect. I'm coming from Cold Fusion where I could just simple use cfdump. Anything in PHP the same.

Posted: Fri Nov 25, 2005 5:38 pm
by Charles256
Posted: Fri Nov 25, 2005 6:38 pm
by trukfixer
if you wanna dump everything at once.. ($_SERVER,$_COOKIE, $_SESSION,$_GET,$_POST,etc)
Code: Select all
echo "<pre>";
var_dump($GLOBALS);
//print_r also works, var_dump gives more detailed information including the data type)
otherwise you can just do var_dump($array) or var_dump($variable) or whatever and see its contents ..
I have used both print_r and var_dump, both are equivalent, print_r is less verbose, I just happen to be in teh habit of hitting var_dump first

Posted: Sat Nov 26, 2005 3:22 am
by onion2k
If you're slightly more confident with PHP (not just starting out) I'd throughly recommend
http://xdebug.org/