note 69813 deleted from function.var-dump by nlopess
| From: | nlopess@php.net | Date: | Fri, 22 Sep 2006 17:36:37 +0000 |
| Subject: | note 69813 deleted from function.var-dump by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117448@lists.php.net to get a copy of this message | ||
Note Submitter: anonymous
----
Thanks to edwardzyang for function var_dump_ret above. For those of us who need to see it in web
server log files -- i.e., using error_log("string") -- instead of on the page, this
version is more readable:
function var_dump_ret_for_error_log($mixed = null) {
ob_start(); //capture output
var_dump($mixed); //dump array/hash/etc.
$content = ob_get_contents(); //finish capture
ob_end_clean(); //wtf? Idk.
$content = strtr($content, "\n", " "); //eliminate newlines
return ereg_replace(" +", " ", $content); //compress multiple spaces
}