• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array  RSS feed

 
mAida Navarro
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question. I could really used your help.



how can i create a function to get the sum of all the elements in the array including the inner array using these $arr = array(60,29,array(23,1),25,60,array(1,5))?
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Your array syntax is more PHP like than Java. What language you want to do this summation in?

Either language will involve looping the array.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!