PHP头条
热点:

php中自定义函数dump查看数组信息类似var_dump


这个很早就有了,比php自带的var_dump好用多了。
代码如下:
function dump($vars, $label = '', $return = false) {
if (ini_get('html_errors')) {
$content = "
\n"; 
if ($label != '') {
$content .= "{$label} :\n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "\n
\n";
} else {
$content = $label . " :\n" . print_r($vars, true);
}
if ($return) { return $content; }
echo $content;
return null;
}

www.phpzy.comtrue/php/19182.htmlTechArticlephp中自定义函数dump查看数组信息类似var_dump 这个很早就有了,比php自带的var_dump好用多了。 代码如下: function dump($vars, $label = '', $return = false) { if (ini_get('html_errors')) { $content = " \n"; if (...

相关文章

PHP之友评论

今天推荐