0
I would calculed the sum the 1 to 10 by for in php,this code is true or false?
<?php for($i=1;$i<=10;$i++){ $i+=$i; } echo "$i"; ?>
2 Answers
+ 6
Nope... define a variable sum before the loop and set it to zero. add i in the loop to sum. after the loop, output sum.
also you don't need the quotation marks in echo if you only want to output a variable.
0
thinks my friend