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

For Loops in PHP Forum

View Course » View Exercise

82 points
E3e08a765c60908839017c1c96a46ee8?s=140&d=retro
Submitted by
nkladwig
almost 4 years ago

[resolved] 3/7 output is correct but doesn't pass

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

output: 102030405060708090100

The other similar posted questions don't provide a definitive answer.
thanks

EDIT: Same with 4/7, output appears correct but doesn't pass

  for ($i = 50; $i >= 5; $i = $i - 5) {
      echo $i;
  }

Output: 5045403530252015105


4 votes

permalink

Cleared browser cache both 3/7 and 4/7 now pass.

Lesson learned.

82 points
E3e08a765c60908839017c1c96a46ee8?s=140&d=retro
Submitted by
nkladwig
almost 4 years ago

1 Comment

A65987ad57258b4bd518413f04737bba?s=140&d=retro Christopher K almost 4 years ago

i did this and it worked

Solo For Loop!



<?php
for($i = 10; $i <= 108; $i = $i + 10)
{
echo $i;
}

?>