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

For Loops in PHP Forum

View Course » View Exercise

674 points
529a762dabf8216fc900ef2c_498229171
Submitted by
Ikillu
over 3 years ago

Answer

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

permalink

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
Picture
Submitted by
Dan
over 3 years ago