Return the sum of all the values in the array (5+15+25):
The array_sum() function returns the sum of all the values in the array.
Parameter | Description |
---|---|
array | Required. Specifies an array |
Return Value: | Returns the sum of all the values in an array |
---|---|
PHP Version: | 4.0.4+ |
Changelog: | PHP versions prior to 4.2.1 modified the passed array itself and converted strings to numbers (which often converted them to zero, depending on their value) |
Return the sum of all the values in the array (52.2+13.7+0.9):