Calculating the Sum of an Array in php November 27, 2021 by Codingtube team The array_sum() function adds up the values in an indexed or associative array: $sum = array_sum(array); For example: