php man page for array_sum

Query: array_sum

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ARRAY_SUM(3)								 1							      ARRAY_SUM(3)

array_sum - Calculate the sum of values in an array

SYNOPSIS
number array_sum (array $array)
DESCRIPTION
array_sum(3) returns the sum of values in an array.
PARAMETERS
o $array - The input array.
RETURN VALUES
Returns the sum of values as an integer or float.
EXAMPLES
Example #1 array_sum(3) examples <?php $a = array(2, 4, 6, 8); echo "sum(a) = " . array_sum($a) . " "; $b = array("a" => 1.2, "b" => 2.3, "c" => 3.4); echo "sum(b) = " . array_sum($b) . " "; ?> The above example will output: sum(a) = 20 sum(b) = 6.9 PHP Documentation Group ARRAY_SUM(3)
Related Man Pages
sum(1b) - opensolaris
array_shift(3) - php
array_pop(3) - php
array_flip(3) - php
array_keys(3) - php
Similar Topics in the Unix Linux Community
Float array sum