You are viewing a single comment's thread. Return to all comments →
For ultimate PHP cheese:
return array_sum($ar);
The standard built-in PHP functions make something like this rather a cake-walk. You can also of course do it with a loop.
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
For ultimate PHP cheese:
return array_sum($ar);
The standard built-in PHP functions make something like this rather a cake-walk. You can also of course do it with a loop.