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; }

22nd Apr 2021, 5:47 AM
andeng
1 Respuesta
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++;
22nd Apr 2021, 6:15 AM
nopatience
nopatience - avatar