The most useful PHP function you’ll ever use!

This is the first thing I add to any PHP based project and I couldn’t live without it..

Most people will probably understand and appreciate what this does, but for those that don’t, it simply displays the contents of an array in a very human readable way by using the <pre> tag to preserve the spacing of the print_r() command.

// Debug Array
function da($array) {
    echo "<pre>\n";
    print_r($array);
    echo "</pre>\n";
}

Enjoy!

No related posts.

This entry was posted in Code Stuff and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>