How to sum the values of an array with the same key in PHP

How to sum the values of an array with the same key in PHP.

PHP Array function to sum values:

Another way to sum the values of an array in php