Your first while loop


$number = 0;
while ($number <11){
echo "


$number += 2;
Please tell me what is wrong with this code cause it seems infinite and I cannot go on. Currently I'm stucked in this exercise, please offer some help...


Hi frentea you did some errors the right code is below
$number = 0;
while ($number <11){
$number += 2;
number is a variable should not be between " ". Hope my answer will help you


Thanks a lot!
But the system automatically run this wrong code every time I open it so there is no way for me to change the code. Is there any solution can stop the system running the code?
Meanwhile, I see in the hint the code is write like this:
$loopCount = 0;
while ($loopCount<4){
echo "

Iteration number: {$loopCount}

$loopCount ++;
I think the loopCount is also a number, but it writes in this way. So what is the right form for numbers?


This code is correct and also you are right loopCount is a number. And I don't know why it run the wrong code.Close your browser and open to try and see.


See this:

The console prints the right numbers but could not pass the exercise.


Yeah i can see it. Can you give me the number of this lesson so I can test it on my side.



Hi, I changed the code to this and it worked. Amazing?


Yes it's amazing because it should work in both cases . But the positive side is that you can now continue.


Thank you for helping me this :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.