// 在使用var_dump/print_r时 打印出来的数组 都是一行显示的, 看起来不方便 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;}