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

For Loops in PHP Forum

View Course » View Exercise

45 points
3d988f9fcee1a6f55e81fc28a1fd624c?s=140&d=retro
Submitted by
natalie89dk
almost 2 years ago

What is wrong here? "Oops, try again. It looks like your loop didn't echo 20."

When i type the code below, it tells me this: "Oops, try again. It looks like your loop didn't echo 20."

Solo For Loop!



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


1 vote

permalink

Ups.. Sorry my last question was wrong. Don't pay attention to that.

When i type the code below, it tells me this: "Oops, try again. It looks like your loop didn't echo 20."

inside the i wrote the following

Solo For Loop!



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

45 points
3d988f9fcee1a6f55e81fc28a1fd624c?s=140&d=retro
Submitted by
natalie89dk
almost 2 years ago

1 Comment

F8324bc81bfd169fd374494b2aa80018?s=140&d=retro Misha almost 2 years ago

Same issue ;/ Really annoying..


0 votes

permalink

this code works for me because we counting by 10

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

466 points
55b88ffa9113cb44e00003c3_865455376
Submitted by
Dini Gcolotela
almost 2 years ago


0 votes

permalink

The "<?php" code was at the starting ,you might have forgot to close it by "?>"

426 points
20a23dc76360ba5062de14b0500443b5?s=140&d=retro
Submitted by
Neeladri Shekhar Pal
over 1 year ago