Listen

$numbers = array(1, 2, 3, 4, 5); $sum = array_reduce($numbers, function($accumulator, $current_value) { return $accumulator + $current_value; }); echo $sum;

Listen

$numbers = array(1, 2, 3, 4, 5); $sum = array_reduce($numbers, function($accumulator, $current_value) { return $accumulator + $current_value; }); echo $sum;