Problem in php (2)


#1

hi there;
I was created a topic at 7 days ago with this title :
problem in php
but i didn't read the answer
and also a should say:
exuse me albionsrefuge for don't cheking the topic.
anyway.
URL to exercise : https://www.codecademy.com/courses/web-beginner-en-L83Do/0/3?curriculum_id=5124ef4c78d510dd89003eb8

the error message I'm seeing : Oops, try again.
Did you set the second part of your loop correctly (the part that ends the loop)? Don't forget your semicolon!

my code:



Solo For Loop!



<?php
// Write your for loop below!
for ($i = 10; $i < 101 ; $i = $i + 1) {
echo $i;
}
?>




#2

Read the instructions again...
It says : Write a for loop that counts up by 10, all the way to 100 (e.g. 10, 20, 30...).


#3

Should you be stepping in 10's?

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

}

#4

thanks ;
but why it's false:
for ($i = 10; $i < 101 ; $i = $i + 10) {
echo "$i" ;
}
and whats the end of this code (i don't learn about this code):
($i = 10; $i < 101; $i += 10)


#5

Does your code output this to the console?

102030405060708090100

#6

no.
but why?
i think is true
when i was writing this code the code cademy choea me this eror:
The program took too long to finish. Check your code for infinite loops and try again.


#7

& also I tested this code in my loccal host and it was working.


#8

The lesson may need to be refreshed. Copy your php code, refresh the page and paste it back in if not the same. Submit again and it should work assuming there are no other errors. Check the console for parsing errors.


#9

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