Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SUM of array

 
   Database Forums (Home) -> PHP RSS
Next:  Between Clause  
Author Message
Maximus

External


Since: Jun 14, 2005
Posts: 3



(Msg. 1) Posted: Tue Dec 27, 2005 2:15 am
Post subject: SUM of array
Archived from groups: comp>lang>php (more info?)

I want to get the sum of the array key values.

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

I want variable $sum = 30.


any solution?

 >> Stay informed about: SUM of array 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
accessing array data inside of an array - I want to extract the name of the photo uploaded. print_r of $_FILES yields: Files: Array ( [picture] => Array ( [name] => DSC_1802-saoirse-riona.jpg [type] => image/jpeg [tmp_name] => /tmp/phpJTspHZ [error] => 0 [size] => 76096 ) ) ...

Array - Hi Can you help me sort my array on salary $Person[$personid][salary] e.g. $Person[1][20000] $Person[2][5000] $Person[3][15000] $Person[4][10000] to $Person[2][5000] $Person[4][10000] $Person[3][15000] $Person[1][20000] Thanx

array() VS Array() - which one is recommend? seems they perform the same thing... regards, howa

Last element of array ? - I need the first, last and middle elements of a (single dimension) array during a loop which may then add 0..n elements to it so I don't know how many elements are in it the next run. Right now I use: [....] $len = count($arr); $var0 = $arr[0];...

assosiativ array - I have this array, $navbar_left = array( 'Hjem'=>'index.php', 'Borte'=>'borte.php', 'Uavgjort'=>'uavgjort.php' ); I want to loop through it, but don't know how. I've tried foreach($navbar_left as $navbar){ foreach($navbar as $key=>$value){ ...
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]