Code
Result

PHP code example: array_reduce

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

You can try this function yourself. Just edit the code and on "Run" to see the result.