Page 1 of 1

print all variables

Posted: Mon Jun 09, 2008 6:39 am
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. :)

Re: print all variables

Posted: Mon Jun 09, 2008 11:58 am
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

Re: print all variables

Posted: Tue Jun 10, 2008 1:45 am
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 ??)

Re: print all variables

Posted: Tue Jun 10, 2008 1:46 am
by Benjamin

Code: Select all

 
print_r($GLOBALS);
 

Re: print all variables

Posted: Tue Jun 10, 2008 2:47 am
by madan koshti
gr8 thanks :)