I\'d like to capture the output of var_dump to a string.
The PHP documentation says;
As with anything that outputs its result directly to the
Here is the complete solution as a function:
function varDumpToString ($var) { ob_start(); var_dump($var); return ob_get_clean(); }