Connecting Tech Pros Worldwide Forums | Help | Site Map

SUM of array

Maximus
Guest
 
Posts: n/a
#1: Dec 27 '05
I have an array filled with data. I need to sum it's value.

example: $key1=>10, $key2=>15, $key3=>5

I want the total of all values which should be: 30

Kimmo Laine
Guest
 
Posts: n/a
#2: Dec 27 '05

re: SUM of array


"Maximus" <teddy.am@gmail.com> wrote in message
news:1135675938.240858.235210@g43g2000cwa.googlegr oups.com...[color=blue]
>I have an array filled with data. I need to sum it's value.
>
> example: $key1=>10, $key2=>15, $key3=>5
>
> I want the total of all values which should be: 30[/color]

array_sum();
http://php.net/manual/en/function.array-sum.php


--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid


Closed Thread