Menu Samaritan's Purse

ARRAY_SUM

Calculate the sum of values in an array

SYNTAX

array_sum ( array $array ) : number

PARAMETERS

array

The input array.

RETURN

Returns the sum of values as an integer or float; 0 if the array is empty.

EXAMPLES

1

3

2

3.6

3

0

PHP