Discoverable pretty print (PHP)
When debugging something in many files, you can have a lot of print_r's and it can be hard to find all of them when you're done debugging. I made myself a shortcut in ST2 that gives me the following line:
echo '<pre>file: '.__FILE__."\nline: ".__LINE__."\n".print_r(, true).'</pre>';
It also places the cursor at the first argument position of the print_r.
This will not only output your variable in a pretty way, but also the location of the line number and file name of where I put the line.
Written by Willem van der Jagt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#