By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,746 Members | 1,780 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,746 IT Pros & Developers. It's quick & easy.

dumping all existing variables

P: n/a
Hi,

Does anybody know a way to dump all used variables and their content?
Is that at all possible?

I am looking for something like print_r(), but have no clue what to feed the
function.
I am mainly interested in variabled created in the script itself, not
$_SERVER and the like.
(I need this for debugging, and get tired of echoing all I might be
interested in.)
TIA

Regards,
Erwin Moller
Feb 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Erwin Moller wrote:
Does anybody know a way to dump all used variables and their content?
Is that at all possible?
print_r($GLOBALS) might be what you're looking for.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 2 '07 #2

P: n/a
Toby A Inkster wrote:
Erwin Moller wrote:
>Does anybody know a way to dump all used variables and their content?
Is that at all possible?

print_r($GLOBALS) might be what you're looking for.
Excactly!
I did try print_r($_GLOBALS) for some mysterious reason.

Thanks Toby.

Regards,
Erwin Moller
Feb 2 '07 #3

P: n/a
Erwin Moller wrote:
I did try print_r($_GLOBALS) for some mysterious reason.
'$GLOBALS' is annoyingly named, given that all the other big superglobals
start with '$_'. I'm often caught out by it.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.