var_dump() echos output directly, so if you want to capture it to a variable to provide your own formatting must use output buffers:
ob_start();
var_dump($var);
$s = ob_get_clean();
Once this is done the variable $s now contains the output of var_dump(), so can safely:
echo "" . $s . "
";