当前位置:Gxlcms > PHP教程 > 工具|PHP格式化输出数组

工具|PHP格式化输出数组

时间:2021-07-01 10:21:17 帮助过:22人阅读

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教程有兴趣的朋友有所帮助。

人气教程排行