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

While Loops in PHP Forum

View Course » View Exercise

67 points
Submitted by
Nelson Malath
about 4 years ago

Not accepting endwhile; code!

I just wrote this code... But its shows: Oops, try again. It looks like you did not use endwhile The code is:

<?php   //Add while loop below
    $loop = 0;
        echo "<p>The Number is: $loop</p>";
        $loop ++;
What is wrong with this???

0 votes


I was having the same problem. Actually all of the while lessons have been giving me errors. I think it has something to do with the realtime updating.

To get past this one I put the endwhile; in first below the closing brace and then removed the braces and added the colon.

76 points
Submitted by
Cody Smoker
about 4 years ago


535084988c1ccc3af600034e_545863751 Tré Rodríguez about 4 years ago

I'm having problems with every lesson too! Often the examples give syntax that the program doesn't accept! blah.

Picture Billy van der Gaag about 4 years ago

Having also some problems with the lessons. In your code I'm missing 'do', perhaps this is the problem?