PHP Manual: array_filter
array_filter
Description
array array_filter ( array input [, callback callback] )
Iterates over each value in
the input array passing them to the
callback function. If the
callback function returns true, the current
value from input is returned into the
result array. Array keys are preserved.
Parameters
inputThe array to iterate over
callbackThe callback function to use
If no
callbackis supplied, all entries ofinputequal to FALSE (see converting to boolean) will be removed.
Examples
Notes
| Caution |
If the array is changed from the callback function (e.g. element added, deleted or unset) the behavior of this function is undefined. |