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

591 points
Submitted by
Buwaneka De Silva
about 3 years ago

Help!!Arrays 3/7

    <title>My First Array</title>
      $arrayfriends= array("do", "re", "mi");

Oops, try again. Did you create an array called $friends? Error shown...

1 vote


You have to call you array $friends instead of $arrayfriends because the scripts check for existance of that particular array with at least 3 strings. Also, I have come to a problem when one of your strings consists of a non standard english character like "Željko" which is common Croatian name. So you still get an error even if everything is OK.

79 points
Submitted by
Domagoj Kučko
about 3 years ago

1 Comment

575728474b7f51faae0002e6_58464479 Buwaneka De Silva about 3 years ago

Thanks! :)

1 vote


What am I doing wrong here?

$friends = array("Friend 1", "Friend 2", "Friend 3", "Friend 4");

Error telling me to remember to put in three elements, and stings in quotes.

928 points
Submitted by
about 3 years ago


15c2c0a95267d8076341e1748c96b1dd?s=140&d=retro Domagoj Kučko about 3 years ago

Spaces are probably causing errors. Try putting "Friend1" etc.

92410b3ad1740b0ed00fec6a3f181476?s=140&d=retro Neel Shivdasani about 3 years ago

I copied the exact array that was used in the previous example to make sure that my syntax was right, and I am getting the error about having at least 3 elements.
$friends = array("Egg", "Tomato", "Beans","Chips","Sausage" );

575728474b7f51faae0002e6_58464479 Buwaneka De Silva about 3 years ago

Stick to 3 element and try again it might work...

Picture Kristen Marie almost 3 years ago

Yeah, it just wants three elements and not more than three even though it says to put at least three elements.

041270520710f71d90aa125baffad434?s=140&d=retro luis_francisco_c almost 3 years ago

the error you have it in the last space... this example is fine: $friends = array("Peter", "Frank", "Oscar" );