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.
Tags: PHP




