I dont think my code is wrong and I tried it to the previous lessons and it worked


#1


<html>
  <head>
    <title>Solo For Loop!</title>
  </head>
  <body>
    <p>
      <?php
      // Write your for loop below!
      for ($i = 0 ; $i < 101 ;  $i = $i + 10) {
          echo $i;
      }
      
      ?>
    </p>
  </body>
</html>

---------------------- that is my code --------------------

Instructions:

Write a for loop that counts up by 10, all the way to 100 (e.g. 10, 20, 30...). Inside the for loop, echo the current value of $i, just like in the examples above

and this is the error

Oops, try again. Did you set the first part of your loop correctly (the part that starts the loop)? Don't forget your semicolon!

---------- bug? ---------


#3

Could be the SCT does not expect white space before the semi-colon. I don't think it matters to PHP so long as the ; is there.


#4

just try $i = 10 i think the question is you need to loop 10 all the way to 100 you put a value 10 instead of 0


#5

the same thing there is still an error , I dont know maybe PHP itself here in codeacademy has alot of bugs. I dont know if I could continue this PHP thing


#6

olryt Ill focus on ruby can you help me with this thing

----- code -----

def alphabetize(arr, rev=false)
arr.sort!
end
numbers [2,3,6,7,8]

puts alphabetize(numbers)

-- INSTRUCTIONS --
Instructions
Inside your method, add a line that calls .sort! on the arr array. Since it is the last line of the method, the sorted array will be returned.
Now test your work! After your method, make a new array called numbers that contains a few numbers like the example above.
Call your alphabetize method with your numbers array as the parameter and puts the result to the console.

-- ERROR --

Oops, try again. It looks like you didn't print anything to the console. Does your method use 'puts' to print the sorted array, and did you remember to call your method?


#7

Ruby in a PHP topic, what gives?


#8

im not sure I'll continue on Ruby then PHP alot of bugs I think


#9

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