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

For Loops in PHP Forum

View Course » View Exercise

675 points
Submitted by
over 4 years ago


heres the answer guys.

  for($i = 10; $i < 101; $i = $i + 10) {
      echo $i;  

You might have to refresh a couple times, but delete the space between for and (), and it should pass.

0 votes


To be clear, the issue here is not the space between the for and (. It's a browser issue where the console is displaying the output of your program and it updates the console every time you change the code. So before you complete the for loop's exit conditions, such as updating the $i variable, the console has already started executing the code and it enters an infinite loop. Changing the code by deleting a space and refreshing the browser is a fix as you mentioned, but it is the refresh that is necessary to get it to re-execute the updated code.

694 points
Submitted by
over 4 years ago