array_filter

(PHP 4 >= 4.0.6)

array_filter --  Filters elements of an array using a callback function

Description

array array_filter ( array input [, mixed callback])

array_filter() returns an array containing all the elements of input filtered according a callback function. If the input is an associative array the keys are preserved.

Note: Instead of a function name, an array containing an object reference and a method name can also be supplied.

See also array_map() and array_reduce().