您好,欢迎访问一九零五行业门户网

使用dump函数,给php加断点测试

本篇文章是对使用dump函数,给php加断点测试进行了详细的分析介绍,需要的朋友参考下
复制代码 代码如下:
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;
}
,香港虚拟主机,香港服务器,香港虚拟主机
其它类似信息

推荐信息