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

While Loops in PHP Forum

View Course » View Exercise

1168 points
7cf61a8cf7315a0e208461e92c640797?s=140&d=retro
Submitted by
b8z
about 4 years ago

Why am I getting this error?????

My code passes, but I'm getting this error:
Parse error: syntax error, unexpected T_WHILE on line 11
Why am I getting it?
Here is my code:
<?php
//Add while loop below
$Arsenal ="10 goals"
while($Arsenal >= "10 goals"):
echo"They have 10 goals!!!"
endwhile;
?>

Any help would be good thanks.


1 vote

permalink

you are missing the semi colon (;) after echo"They have 10 goals!!!"

43 points
6d9a25c6db49263377a0f6723ddc60ca?s=140&d=retro
Submitted by
ryspurge
about 4 years ago

1 Comment

18d3c9d2eea32b5334f581e85e1e83b1?s=140&d=retro Jordi Baldó almost 4 years ago

try this !!

$Arsenal ="10 goals";
while($Arsenal >= "10 goals"):
echo"They have 10 goals!!!";
endwhile;
?>