array_reduce

array_reduce -- Iteratively reduce the array to a single value using a callback function

Description

mixed array_reduce ( array input, mixed callback [, int initial])

array_reduce( ) applies iteratively the callback function to the elements of the array input , so as to reduce the array to a single value .

דוגמה 1 . array_reduce( ) example