Doing print_r, returns pages and pages of code; it’s too hard to scroll pages to match children to parents, even wrapped with <pre> tags.
Is there a way to theme print_r into collapsible fields. Maybe an online generator, where I can post the contents of the print_r($array); and get a collapsible table of fields.
For example, in Drupal, there’s a module, called Devel, that does just that.

Thanks to this post, here’s a solution.
Insert the following function, right before the
print_r.And then, substitute
print_r(), withprint_r_tree(); like this:Don’t forget the
<pre>tags.The results look identical to that of
print_r()function, except that now the arrays are collapsible.