How would I display all the variables on a current page
Moderator: General Moderators
How would I display all the variables on a current page
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. 
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
- trukfixer
- Forum Contributor
- Posts: 174
- Joined: Fri May 21, 2004 3:14 pm
- Location: Miami, Florida, USA
if you wanna dump everything at once.. ($_SERVER,$_COOKIE, $_SESSION,$_GET,$_POST,etc)
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
Code: Select all
echo "<pre>";
var_dump($GLOBALS);
//print_r also works, var_dump gives more detailed information including the data type)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
If you're slightly more confident with PHP (not just starting out) I'd throughly recommend http://xdebug.org/