时间:2021-07-01 10:21:17 帮助过:1人阅读
dump() 把数组以数组格式数组,有益于调试
function dump($vars, $label = , $return = false){
if (ini_get(html_errors)) {
$content = "
";";
if ($label != ) {
$content .= "{$label} : ";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "
array_remove_empty()去除数组中为空的元素
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默认函数 作用是把函数平均分组
http://www.bkjia.com/PHPjc/486562.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486562.htmlTechArticledump() 把数组以数组格式数组,有益于调试 function dump($vars, $label = , $return = false){ if (ini_get(html_errors)) { $content = "pre"; if ($label != ) { $content ....