print all variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madan koshti
Forum Commoner
Posts: 50
Joined: Fri Jun 06, 2008 4:25 am

print all variables

Post by madan koshti »

Hello Everyone,

How can I display all the variables (without specifying the variable names)?? just like
print_r($_POST) , which will show all the (reachable/live variable )with name and there current values .

(I think this will be very helpfully for debugging) the reply will be really appreciated. :)
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: print all variables

Post by Jonah Bron »

Every single variable on the page? There would have to be an array somewhere with all the vars on the page, though I don't know if something such as that exists. Check PHP: Predefined variables
madan koshti
Forum Commoner
Posts: 50
Joined: Fri Jun 06, 2008 4:25 am

Re: print all variables

Post by madan koshti »

Hi PHPyoungster,

yes I want Every single variable on the page ....

(can we do this by reading anything php cores ?? e.g:symbol tables etc..or anything else ??)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: print all variables

Post by Benjamin »

Code: Select all

 
print_r($GLOBALS);
 
madan koshti
Forum Commoner
Posts: 50
Joined: Fri Jun 06, 2008 4:25 am

Re: print all variables

Post by madan koshti »

gr8 thanks :)
Post Reply