Creating your First Array - Arrays


#1



Hello people, I started learning PHP. And yep, it's buggy for a little. My code is fine, but it doesn't let me go. The error post looks like this:

Oops, try again. Did you remember to put at least three elements in your array? Make sure each one is a string in quotes!

If my eyes aren't lying, I have three elements with quotes in my array.


<html>
  <head>
    <title>My First Array</title>
  </head>
  <body>
    <p>
      <?php
    $friends = array("people", "more people", "people again");
        ?>
  </body>
</html>


#2

Hmm... Looks right to me.

My only suggestion for you, @papusalaatti, is to try fixing the indentation of the line where you declare the array. If you fix that, it should work.


#3

Gotcha:
I can't add spaces to the array. I changed it to three random strings without spaces, and that worked.
CASE CLOSED.


#4

This is a bit irrelevant, but I remember suggesting that you take PHP a few weeks ago, so I'm glad you decided to! :)))


#5

Yup, I took it yesterday and I understood that I love it.


#6

I have the same issue. Get a hint isn't working either. I just cannot go further. Even if I copy yours, I cannot go further. What did you do?


#7

Answered in post 3 by papusalaatti.


#8

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