首页  >  文章  >  后端开发  >  工具|PHP格式化输出数组

工具|PHP格式化输出数组

WBOY
WBOY原创
2016-07-29 08:58:203174浏览
<code>function dump($vars, $label = '', $return = false) {
    if (ini_get('html_errors')) {
        $content = "<pre class="brush:php;toolbar:false">\n";
        if ($label != '') {
            $content .= "<strong>{$label} :</strong>\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 常量