How can all values in an array be added together in PHP?

To add all values in an array together in PHP, you can use the `array_sum()` function. This function takes an array as an argument and returns the sum of all the values in the array. Simply pass your array to `array_sum()` to get the total sum of all values.

$numbers = [1, 2, 3, 4, 5];
$totalSum = array_sum($numbers);
echo "The total sum of all values in the array is: " . $totalSum;