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

While Loops in PHP Forum

View Course » View Exercise

67 points
565d7d2e51b887ffd90006fd_883637432
Submitted by
Nelson Malath
about 3 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;
    while($loop<=8):
        echo "<p>The Number is: $loop</p>";
        $loop ++;
    endwhile;
    ?>
What is wrong with this???

0 votes

permalink

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
Ca32eba3cacb7798138100b5ff8603da?s=140&d=retro
Submitted by
Cody Smoker
about 3 years ago

2 Comments

535084988c1ccc3af600034e_545863751 Tré Rodríguez almost 3 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 almost 3 years ago

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