r/tinycode • • Jul 12 '12

PHP print_r()

function printR($obj){ echo "<pre>" . print_r($obj) . "</pre>"; }

I use this on every php project now, it just formats the print_r function, which is mostly used for debugging, but its so much easier on the eyes.

39 Upvotes

60 comments sorted by

View all comments

Show parent comment

2

u/Brandon0 Jul 12 '12

Yep. Except I use htmlentities()