Fill an array with values, specifying keys:
The array_filter() function filters the values of an array using a callback function.
This function passes each value of the input array 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.
Parameter | Description |
---|---|
array | Required. Specifies the array to filter |
callbackfunction | Required. Specifies the callback function to use |
Return Value: | Returns the filtered array |
---|---|
PHP Version: | 4.0.6+ |