Home > Backend Development > PHP Tutorial > The custom function dump in php to view array information is similar to the var_dump_PHP tutorial

The custom function dump in php to view array information is similar to the var_dump_PHP tutorial

WBOY
Release: 2016-07-13 10:39:49
Original
1036 people have browsed it

This has been around for a long time and is much easier to use than the var_dump that comes with PHP.

Copy code The code is as follows:

function dump($vars, $label = '', $return = false) {
if (ini_get('html_errors')) {
$content = "
n"; <br>if ($label != '') { <br>$content .= "< strong>{$label} :</strong>n"; <br>} <br>$content .= htmlspecialchars(print_r($vars, true)); <br>$content .= "n
n";
} else {
$content = $label . " :n" . print_r($vars, true);
}
if ($return) { return $content; }
echo $content;
return null;
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/728103.htmlTechArticleThis has been around for a long time, and it is much easier to use than the var_dump that comes with PHP. Copy the code The code is as follows: function dump($vars, $label = '', $return = false) { if (ini_get('html_errors')) { $content...
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