/**
* [dump_array 将数组内容格式化输出]
* @param array $vars [数组]
* @param string $label [分隔符]
* @param boolean $return [是否返回结果]
* @return [type] [description]
*/
function dump_array($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;
}
转载于:https://blog.51cto.com/yuhanjue/1717132