Hey there,
can somebody tell me the function for how to het the sum fo all teh values in an array
Thanks a lot
Why not "array_sum"?
how do you mean that
the array is the following:
$number[$index]
how should I build that then???
Thanks
Try the following: <?php $number = array(0,5,10,15,20);
$array_elements = count($number); $sum_elements = array_sum($number);
echo "Total elements in array: ".$array_elements."<BR>"; echo "The sum of the elements: ".$sum_elements."<BR>"; ?>