RE: [PHP] Simple (?) var_dump question
| From: | Wouter van Vliet | Date: | Fri, 12 Sep 2003 16:48:24 +0000 |
| Subject: | RE: [PHP] Simple (?) var_dump question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162432@lists.php.net to get a copy of this message | ||
aiaiaia ... you are all pretty right, for another function was forged.
var_export has a "return" flag as second argument where print_r and var_dump
both have other variables as second (and third, and fourth, and sixth) ..
So you can do: $logger->debug(var_export($Var), true)); which will log the
var to your log.
-> -----Oorspronkelijk bericht-----
-> Van: Chris Boget [mailto:chris@wild.net]
-> Verzonden: vrijdag 12 september 2003 18:34
-> Aan: CPT John W. Holmes; Thomas Panzarella; php-general@lists.php.net
-> Onderwerp: Re: [PHP] Simple (?) var_dump question
->
->
-> > > 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.
->
-> Not true. You have to use output buffering for print_r() as
-> well. print_r()
-> just returns a boolean value.
-> It'd be nice if you could have it so that either (or both)
-> print_r() or var_dump()
-> could return a value w/o using buffering...
->
-> Chris
->
-> --
-> PHP General Mailing List (http://www.php.net/)
-> To unsubscribe, visit: http://www.php.net/unsub.php