PHP array_sum() Function

The array_sum() function is used to calculate the sum of values in the array.The array_sum() function returns the sum of all the values in the array.

Example -

Example -