Dump () takes an array of arrays in array format, which is useful for debugging
function dump ($vars, $label =, $return = False) {
if (Ini_get (html_errors)) {
$content = "
";
if ($label! =) {
$content. = "{$label}:";
}
$content. = Htmlspecialchars (Print_r ($vars, true));
$content. = "
";
} else {
$content = $label. " :" . Print_r ($vars, true);
}
if ($return) {return $content;}
Echo $content;
return null;
}
Array_remove_empty () removes empty elements from the array
Function Array_remove_empty (& $arr, $trim = True) {
foreach ($arr as $key = = $value) {
if (Is_array ($value)) {
Array_remove_empty ($arr [$key]);
} else {
$value = Trim ($value);
if ($value = =) {
Unset ($arr [$key]);
} elseif ($trim) {
$arr [$key] = $value;
}
}
}
}
Array_chunk () PHP default function is to group functions evenly
http://www.bkjia.com/PHPjc/486562.html www.bkjia.com true http://www.bkjia.com/PHPjc/486562.html techarticle dump () takes an array of arrays in array format, which is useful for debugging function dump ($vars, $label =, $return = False) {if (Ini_get (html_errors)) {$content = "pre" ; if ($label! =) {$content ....