This forum is now read-only. Please use our new forums at discuss.codecademy.com.

While Loops in PHP Forum

View Course » View Exercise

365 points
53ff493752f863273e001f69_101756015
Submitted by
Firekitty224
over 2 years ago

I'm getting a weird error but my code passes

I don't know what I did! Here's my code

<?php
//Add while loop below
$countup = 0
while ($countup < 24):
    echo "$countup" + " ";
    $countup ++;
endwhile;
?>

It says that "Parse error: syntax error, unexpected T_WHILE on line 11".
line 11 is while ($countup < 24): btw
Thank you in advance!


1 vote

permalink

EDIT: For all getting this error, it's really simple:
put a semicolon after $countup = 0.
DAMN SEMICOLONS!

365 points
53ff493752f863273e001f69_101756015
Submitted by
Firekitty224
over 2 years ago