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.
Back to Tech Journal