How does the array_sum() function differ from the sum_array() function in PHP?

The array_sum() function in PHP calculates the sum of values in an array, while the sum_array() function does not exist in PHP. To calculate the sum of values in an array, you should use the array_sum() function.

// Example of using array_sum() function
$array = [1, 2, 3, 4, 5];
$sum = array_sum($array);
echo $sum; // Output: 15