PHP:Sum an Array

From Progzoo
Jump to: navigation, search

You can add the numbers in the array [6,7,29] using a loop.

An alternative (and better) method:

$a=array(6,7,29);
echo array_sum($a);
[Font] [Default] [Show] [Resize] [History] [Profile]