Easy Tutorial
❮ Php Imagecolorexactalpha Func Error Trigger Error ❯

PHP array_sum() Function

Complete PHP Array Reference Manual

Example

Returns the sum of all values in the array (5+15+25):


Definition and Usage

The array_sum() function returns the sum of all values in the array.


Syntax

Parameter Description
array Required. Specifies the array.

Technical Details

Return Value: Returns the sum of all values in the array.
PHP Version: 4.0.4+
--- ---
Changelog: Prior to PHP 4.2.1, the function modified the input array itself, converting string values to numeric values (most often to zero, depending on the specific value).
--- ---

More Examples

Example 1

Returns the sum of all values in the array (52.2+13.7+0.9):


❮ Php Imagecolorexactalpha Func Error Trigger Error ❯