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

While Loops in PHP Forum

View Course » View Exercise

1175 points
A5ba1285e8142aa3740cc08378e41d6c?s=140&d=retro
Submitted by
Reianna-Bryant
about 2 years ago

Why is the same thing happening twice?

This is my code for the "endwhile" lesson:
$loopCount = 2;
while ($loopCount < 8);
echo "Starting number: {$loopCount}";
$loopCount ++;
endwhile;
>?

It look fine, but I get a new error message in the output box saying "Parse error: syntax error, unexpected T_ENDWHILE on line 14". Can someone explain what is going on?


0 votes

permalink

Because it is ?> not >? On last line.

125 points
91ea0d13f213ee15d29e8f24b295420f?s=140&d=retro
Submitted by
Mubeen001
about 2 years ago