dump() 把数组以数组格式数组,有益于调试
function dump($vars, $label = '', $return = false){
if (ini_get('html_errors')) {
$content = "<사전>n";
if ($label != '') {
$content .= "<strong>{$label} :</strong>n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "n</pre>n";
} 또 다른 {
$content = $라벨 . " :N" . print_r($vars, true);
}
if ($return) { $content 반환; }
$ 내용을 에코;
null을 반환;
}
array_remove_empty()제거
기능 array_remove_empty(& $arr, $trim = true){
foreach ($arr $key => $value) {
if (is_array($value)) {
array_remove_empty($arr[$key]);
} 또 다른 {
$value = 트림($value);
if ($value == '') {
unset($arr[$key]);
} elseif ($trim) {
$arr[$key] = $값;
}
}
}
}
array_chunk() php默认函数 작업용 是把函数平均分组