Home  >  Article  >  Backend Development  >  Tools | PHP formatted output array

Tools | PHP formatted output array

WBOY
WBOYOriginal
2016-07-29 08:58:203210browse
<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; }

Reference:

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

The above has introduced the tool | PHP formatted output array, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn