note 46463 added to function.print-r
| From: | Theo at osu1 dot php dot net | Date: | Tue, 12 Oct 2004 14:59:30 +0000 |
| Subject: | note 46463 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78424@lists.php.net to get a copy of this message | ||
With a print_r() function, you have to look at the code source.
This fonction convert the print_r to valid HTML code
<?php
function print_r_html($var,$view=true)
{
ob_start() ;
print_r($var);
$printr = ob_get_flush();
$final='<br>'.str_replace(array("\n","
"),array("\n<br>"," "),$printr).'<br>';
if ($view)
{
print $final;
return ;
}
else
{
return $final;
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.print-r.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46463
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46463&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46463&report=yes
Search -- http://master.php.net/manage/user-notes.php