February 2013
Intermediate to advanced
538 pages
20h 55m
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);
$newArray = array_filter($array, "isBig"); // contains (11, 12, 13, 14)Read now
Unlock full access