Re: Emulation: $var = print_r($array)
| From: | Philip Olson | Date: | Thu, 04 Apr 2002 17:52:19 +0000 |
| Subject: | Re: Emulation: $var = print_r($array) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91561@lists.php.net to get a copy of this message | ||
> > Is there a way to "emulate" var_dump(), print_r() so I can write it to a
> > file and when I open this file the information are shown like if I really
> > did a print_r();?
>
> ob_start();
> print_r($doo);
> $dah = ob_get_contents();
> ob_end_clean();
> echo $dah;
and just a fyi, var_export() exists in PHP 4.2.0.
Regards,
Philip