March 2002
Intermediate to advanced
528 pages
21h 29m
English
array_filter
array array_filter(arrayarray, mixedcallback)
Creates an array containing all values from the original array for
which the given callback function returns true. If
the input array is an associative array, the keys are preserved. For
example:
function isBig($inValue) {
return($inValue > 10);
}
$array = array(7, 8, 9, 10, 11, 12, 13, 14);
$new_array = array_filter($array, "isBig"); // contains (11, 12, 13, 14)Read now
Unlock full access