print_r into a variable
Posted February 19, 2007on:
print_r is a great function. No matter how deeply nested your arrays are,
print_r() will dump all the contents out into a neatly indented textual ouput for you to look at.
But what if you need to use the output of
print_r() in a variable? Simply set the return flag like so:
$myVar = print_r($bigArray, true);
$myVar now contains the output of