we can find sum of array elements using array_sum function
eg: create an array $arr = array(2,4,3,2,1);
$sum_of_elements = array_sum($arr);
echo $sum_of_elements; //12 It prints the 12.
we can find sum of array
Mon, 12/08/2008 - 22:13 — adminwe can find sum of array elements using array_sum function
eg: create an array $arr = array(2,4,3,2,1);
$sum_of_elements = array_sum($arr);
echo $sum_of_elements; //12
It prints the 12.