Re: print_r's feature
| From: | John Lim | Date: | Thu, 25 Jul 2002 08:49:52 +0000 |
| Subject: | Re: print_r's feature | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86180@lists.php.net to get a copy of this message | ||
Try this:
//debugging print_r
function print_pre($r,$prefixmsg='')
{
if ($prefixmsg) $prefixmsg .= ' ';
print "<pre>$prefixmsg";
$s = "\n(\n";
ob_start();
print_r($r);
ob_end_flush();
print '</pre>';
}
"Denis Arh" <xbite@exonium.net> wrote in message
news:20020725081345.37382.qmail@pb1.pair.com...
> Yeah, i know this... but... ok... ;)
>
> wouldn't be simplier like this:
>
> print_r($foo, true);
>
> i know how to do it, it was just a suggestion...
>
>
> "Marco Glatz" <MarcoGlatz@Dose.com> wrote in message
> news:C1A8D5312515D411908C0050BAB3C06F0FA1A0@GATEWAY...
> >
> > > How about adding an extra second parameter to print_r
> > > function, that would
> > > enable HTML output, with <br />s and maybe bold values?
> >
> > how about this ?
> >
> > <pre>
> >
> > <?php print_r($foo); ?>
> >
> > </pre>
> >
> >
> > mg
>
>