工具|PHP格式化输出数组

原创
2016-07-29 08:58:20 2805浏览
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; }

参考:

  1. http://www.birdol.com/web/751.html

以上就介绍了工具|PHP格式化输出数组,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一条:php入门自学小展示 下一条:PHP 5 常量