If the callback function is not provided, Array_filter () deletes all entries in input that are equivalent to FALSE.
You can use this function when you delete an element that is empty in an array.
Copy CodeThe code is as follows:
To delete an element in an 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.html www.bkjia.com true http://www.bkjia.com/PHPjc/319816.html techarticle if the callback function is not provided, Array_filter () deletes all entries in input that are equivalent to FALSE. You can use this function when you delete an element that is empty in an array. Copy Code ...