Re: Simple (?) var_dump question
| From: | CPT John W. Holmes | Date: | Fri, 12 Sep 2003 15:40:50 +0000 |
| Subject: | Re: Simple (?) var_dump question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162426@lists.php.net to get a copy of this message | ||
From: "Thomas Panzarella" <TPanzarella@fcny.org>
> Hi. I'm new to the list so sorry if this has already
> been asked before ...
>
> I want to find a way to capture the var_dump
> output as a string so I can write it to a log file ...
> (for example):
>
> $logger->debug(var_dump($foo));
>
> So, the above line would get a "var_dump
> stringified" version of $foo and pass it to my
> logger's debug method.
You need to use output buffering to capture the output with var_dump.
Or you can use print_r(), which will give you a similar output and can be
returned to a varible.
---John Holmes...