PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
shoxlx
Forum Newbie
Posts: 23 Joined: Tue Oct 11, 2005 10:42 pm
Post
by shoxlx » Wed Nov 09, 2005 7:08 pm
Is there a way to count up all the numbers in an array?
ex :: array('1','2','5','3'); would be counted up to 11
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Nov 09, 2005 7:11 pm
You can write a function to do that...
Traverse through the array and add each to the sum of the previous addition.
shoxlx
Forum Newbie
Posts: 23 Joined: Tue Oct 11, 2005 10:42 pm
Post
by shoxlx » Wed Nov 09, 2005 7:13 pm
ys i know, but i was just wondering if there was a simpler way...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Nov 09, 2005 7:19 pm