PHP Manual:
array_filter

array_filter

(PHP 4 >= 4.0.6, PHP 5)

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

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

input

The array to iterate over

callback

The callback function to use

If no callback is supplied, all entries of
input equal to FALSE (see
converting to
boolean) will be removed.