复制代码 代码如下:
function dump($var, $echo=true,$label=null, $strict=true)
{
$label = ($label===null) ? '' : rtrim($label) . ' ';
if(!$strict) {
if (ini_get('html_errors')) {
$output = print_r($var, true);
$output = .$label.htmlspecialchars($output,ent_quotes).
;
} else {
$output = $label . : . print_r($var, true);
}
}else {
ob_start();
var_dump($var);
$output = ob_get_clean();
if(!extension_loaded('xdebug')) {
$output = preg_replace(/\]\=\>\n(\s+)/m, ] => , $output);
$output = ''. $label. htmlspecialchars($output, ent_quotes). '
';
}
}
if ($echo) {
echo($output);
return null;
}else
return $output;
}
http://www.bkjia.com/phpjc/327834.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/327834.htmltecharticle复制代码 代码如下: function dump($var, $echo=true,$label=null, $strict=true) { $label = ($label===null) ? '' : rtrim($label) . ' '; if(!$strict) { if (ini_get('html_errors'...