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

While Loops in PHP Forum

View Course » View Exercise

485 points
512e8231cc434199830006d2_173484811
Submitted by
Motti Tadmor
almost 4 years ago

Loop never comes back?

Not sure what is wrong in my code, I do have the false statement to end the loop, but it seems that the loop never finishes (when I press the submit button, result is never returned...) can someone help?

<!DOCTYPE html>


A loop of your own



<?php
$myAge = 50;
while ($myAge < 40) :
echo "You are young";
$myAge = false;
endwhile;
echo "Too Old...";
?>


1 vote

permalink

@Motti, I run you and there's no error in it. Try refreshing your page.
I hope you already figured out how to solve it. =)

386 points
5488843751b887a605000041_252300226
Submitted by
Rein Sano
almost 4 years ago