note 46463 deleted from function.print-r by sean
| From: | sean@php.net | Date: | Tue, 12 Oct 2004 15:12:25 +0000 |
| Subject: | note 46463 deleted from function.print-r by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78427@lists.php.net to get a copy of this message | ||
Note Submitter: Theo
----
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;
}
}
?>
----
Reason: useless example