1 2 3 4 5 6 7 8 9 10
<?php function prob1(){ $sum1 = 0; for($i=0; $i<16; $i++){ $sum1 = $sum1 + $i; } echo "Sum of numbers 1 - 10 is:". $sum1; } prob1(); ?>
1
Sum of numbers 1 - 10 is:120