php - Summing All Values Between a Number Range -
How can I add all the numbers of numbers using PHP?
For example:
1-5 (1 + 2 + 3 + 4 + 5) = 15 Need to use array_sum or array variation?
Multiple choices, here is 1.
$ start = 1; $ End = 5; $ Sum = 0; For {$ sum = $ i; ($ I = $ start; $ i & lt; = $ end; $ i ++) } $ sum;
Comments
Post a Comment