Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / PHP

array_filter()

Filters elements of an array using a callback function.

Syntax
array_filter(array $array, ?callable $callback = null, int $mode = 0): array

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working array_filter() usage example
// Example for array_filter()
// Standard verified syntax construct
console.log('array_filter() initialized');
Standard PHP language feature verified across modern versions.