Core Function SumValues

From Sputnik Wiki
Revision as of 12:37, 14 June 2015 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
SumValues( <array> )

Contents

Description

Counts the sum total of all the values of an array.

Parameters

array

The array to use.

Return Value

Success: Returns the sum of values

Failure: 0

Remarks

This is recursive and it will collect the sum from all additional arrays contained every array it finds.

Example

$a = array(2, 4, 6, 8);
say ("sum(a) = " . SumValues($a)); // 20
 
$b = array("a" => 1.2, "b" => 2.3, "c" => 3.4);
say ("sum(b) = " . SumValues($b)); // 6.9
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox