...

print_r wrapper

redixx
06-14-2011, 09:26 PM
This is just a simple little wrapper I always use in development for print_r(). I hate how it is just an enormous string of text, so I just wrap it in pre tags.


function print_arr($array)
{
echo '<pre>';
echo print_r($array);
echo '</pre>';
}


Simple, useful.

Inigoesdr
06-14-2011, 10:07 PM
You can also write that this way so it's one line:
echo '<pre>', print_r($array, true), '</pre>';

redixx
06-14-2011, 10:36 PM
Nice, I didn't know about the second argument.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum