array_sum

It finds the sum of values in an array

Example

<?php
$array = array(1, 7, 5, 8);
echo array_sum($array);
?>

Output

21

Share