If no callback function is provided, array_filter() will remove all entries in input whose value is FALSE.
You can use this function to delete null elements in the array.
Copy code The code is as follows:
//Delete an element in the array
function array_remove_value(&$arr, $var){
foreach ($arr as $key => $value) {
if (is_array($value)) {
array_remove_value($arr[$key], $var);
} else {
$value = trim($value);
if ($value == $var) {
unset($arr[$key]);
} else {
$arr[$key] = $value;
}
}
}
}
http://www.bkjia.com/PHPjc/319816.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319816.htmlTechArticleIf no callback function is provided, array_filter() will delete all entries in the input that have a value of FALSE. You can use this function to delete null elements from an array. Copy code...