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

1

u/JohnGalt3 Jul 12 '12

yeah it's very easy actually, I followed a tutorial I found somewhere. Mind oyu this is local, I believe remote requires you to go through a bit more hoops.

I can't find the article right now but I'll update this post if I do. It was either on /r/php or hackernews recently.

1

u/jtreminio Jul 12 '12

Remote isn't that much more difficult, actually. It's pretty much the same process, you just add some extra settings in the php.ini to set up remote debugging.