Source Code:
(back to article)
<?php $numbers = array(1, 2, 3, 4, 5); $sum = 0; foreach ($numbers as $number) { $sum += $number; } echo "The sum of the numbers is: " . $sum; ?>
Result:
Report an issue