英[s?m] 美[s?m]

n.Amount; total; arithmetic; outline, key points

vt.& vi.Summary; total; summary, summary

Third person singular: sums Plural: sums Present participle: summing Past tense: summed Past participle: summed

php array_sum() function syntax

Function: Return the sum of all values ??in the array

Syntax: array_sum(arra)

Parameters:

ParametersDescription
array Required. Specifies an array.

Description: If all values ??are integers, return an integer value. If one or more of the values ??is a floating point number, a floating point number is returned.

php array_sum() function example

<?php
$a=array("口紅"=>199,"粉底"=>349,"眼影"=>99);
echo array_sum($a);
?>

Run instance?

Click the "Run instance" button to view the online instance

Output:

647
<?php
$arr = array('螞蟻花唄要還' => 578,'螞蟻借唄要還' => 1500, '網(wǎng)上銀行要還' => 2000);
echo "那么你這個月要還".array_sum($arr);
?>

Run Instance?

Click the "Run Instance" button to view the online instance

Output:

那么你這個月要還4078