Improved spacing in pretty_dump

feature/node-rewrite
Sven Slootweg 13 years ago
parent 3756e1a462
commit 8b854b7385

@ -98,10 +98,19 @@ function clean_array($arr)
function pretty_dump($input) function pretty_dump($input)
{ {
ob_start(); ob_start();
var_dump($input); var_dump($input);
$output = ob_get_contents(); $output = ob_get_contents();
ob_end_clean(); ob_end_clean();
$output = nl2br(str_replace(" ", "   ", $output));
while(preg_match("/^[ ]*[ ]/m", $output) == 1)
{
$output = preg_replace("/^([ ]*)[ ]/m", "$1   ", $output);
}
$output = nl2br($output);
echo($output); echo($output);
} }

Loading…
Cancel
Save