Having issues despite seeing correct results?


#1

For Loops in PHP number 6, Practicing with ForEach

Not sure if I'm blind, but I'm 100% sure that my code is correct and I can even see the canvas is showing, "I'm learning PHP!". I've reloaded the page, exited browser and came back, etc. but keep getting this message:

"Oops, try again. Oops! Did you make sure to replace all the _s in your code with the correct for loop syntax?"

My code for those who are helping.

<html>
  <head>
    <title></title>
  </head>
  <body>
    <p>
      <?php
        $sentence = array("I'm ", "learning ", "PHP!");
        
        foreach ($sentence as $word) {
          echo $word;
        }
      ?>
    </p>
  </body>
</html>


#2

RESOLVED! For those having the same issue, here's what I did.

1) Change <?php to <?ph

2) Change it back

3) If you have correct code, it should work.


#3

your code is fine. just reload/refresh your browser :slight_smile:


#4

That doesn't work. I even said so in the post. :confused:

I also fixed it by now.


#5

sorry i didn't read completely.its good you fixed it. :slight_smile:


#6

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