Friday, July 13, 2012

PHP: Capture var_dump into string


Using output buffering:

<?php
ob_start();
var_dump($someVar);
$result = ob_get_clean();
?>


Resource:
http://stackoverflow.com/questions/139474/how-can-i-capture-the-result-of-var-dump-to-a-string

No comments: