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

array_reduce()

Iteratively reduce the array to a single value using a callback function.

Syntax
array_reduce(array $array, callable $callback, mixed $initial = null): mixed

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

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