Tech Journal Back to Tech Journal

How can I print out the structure of variable in PHP?

You can do:

$out = print_r($var, true)

to get the output of print_r into a string, which is a structured representation of the $var.

Last updated on 2006-10-07 15:00:00 -0700, by Shalom Craimer

Back to Tech Journal