The custom dump function in php looks at array information like var_dump

  • 2020-12-20 03:31:38
  • OfStack

This has been around for a long time and is much better than php's built-in var_dump.
 
function dump($vars, $label = '', $return = false) { 
if (ini_get('html_errors')) { 
$content = "<pre>\n"; 
if ($label != '') { 
$content .= "<strong>{$label} :</strong>\n"; 
} 
$content .= htmlspecialchars(print_r($vars, true)); 
$content .= "\n</pre>\n"; 
} else { 
$content = $label . " :\n" . print_r($vars, true); 
} 
if ($return) { return $content; } 
echo $content; 
return null; 
} 

Related articles: