dump() 把吞吐量以陣列方式吞吐量,優於 debugfunction
dump($vars, $label = '', $return = false){
if (ini_get('html_errors')) {
$內容 = "<前>n";
如果($標籤!=''){
$content .= "<strong>{$label} :</strong>n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "n</pre>n";
} 別的 {
$內容=$標籤。 “:n”。 print_r($vars, true);
}
if ($return) { 回傳 $content; }
回顯$內容;
返回空值;
}
array_remove_empty() 去除負載中為空的元素
function array_remove_empty(& $arr, $trim = true){
foreach ($arr 作為 $key => $value) {
if (is_array($value)) {
array_remove_empty($arr[$key]);
} 別的 {
$值=修剪($值);
如果($值==''){
取消設定($arr[$key]);
} elseif ($trim) {
$arr[$key] = $value;
}
}
}
}
array_chunk() php預設函數 作用是將函數平均分組