0
Hi can i ask? Which of the following is the correct syntax for a while statement? can you provide your stand of choice.
a. while ($1 <= 5, ++$i){ $echo "<p>I</p>"; } b. while ($i <= 5){ $echo "<p>$i</p>"; ++$i; } c. while ($i <= 5){ $echo "<p>$i</p>"; ++$i: } d. while ($i <= 5; echo "<p>$i</p>"); ++$i; }
1 Answer
0
while ($i<=5){
echo "<p>$i<p>";
$i++;
}
$echo <-- echo is not a variable, use echo without the $ symbol
++$i; <-- this is wrong, do this $i++;