How can I understand the code? Array_filter & lt ;? Php & nbsp; $ arrarray (0, 0, 1, 2, 4); & nbsp; $ arrarray_filter ($ arr); & nbsp; print_r ($ arr );? & Gt; does not require array_filter (array, function )? Does writing arrays directly mean that the user-defined function value is zero? Array_filter
$ Arr = array (, 2 );
$ Arr = array_filter ($ arr );
Print_r ($ arr );
?>
Is array_filter (array, function) not required )? Does writing an array directly mean that the user-defined function value is zero? Or how to understand it? Please advise
------ Solution --------------------
Array array_filter (array [, callback])
Array_filter () transmits each value in the array to the callback function in sequence. If the callback function returns TRUE, the current value of the array is included in the returned result array. The key name of the array remains unchanged.
If the callback function is not provided, array_filter () deletes all entries in the array that are equal to FALSE.
If the value is false, it is null, false, 0 .......
------ Solution --------------------
Flase false true