How to calculate the sum of values in an array

by sabitha 2012-06-05 14:25:33

<h2>How to calculate the sum of values in an array</h2>

$myarr = array(2, 4, 6, 10);
echo "Array sum : ".array_sum($myarr);

will outputs
Array sum : 22

Tagged in:

403
like
0
dislike
0
mail
flag

You must LOGIN to add comments