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

Tools | PHP formatted output array

WBOY
Release: 2016-07-29 08:58:20
Original
3245 people have browsed it
<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; }
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template