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

Arrays Forum

View Course » View Exercise

363 points
Submitted by
almost 3 years ago

Do you mean use echo to output an item from $languages?

Hi there! Just noting that following the current instructions in exercise 6/7 of Arrays, the second task asks to use echo to output $languages. I think it's really asking to use echo to output an item from $languages.

4 votes


eventhough your code is correct, the interpreter gets messed up sometimes. Using this one,which is equal to yours in correctness may work !

    $languages = array("HTML/CSS",
    "JavaScript", "PHP", "Python", "Ruby");
    $languages[1] = "oo"; 
    echo $languages[1];

102 points
Submitted by
Mohammad Jannaty
almost 3 years ago

1 Comment

54d7878fe39efe8c7a001863_756191777 MananC07 over 2 years ago

Thnxx IT Worked For Me

2 votes


Echo out the element that you changed and it should work

394 points
Submitted by
almost 3 years ago

0 votes


I noticed this as well. The instructions state to output $languages, but that only returns the text "Array". This is unexpected and I suppose I'll figure out why it didn't print out the list in a future lesson.
I altered the code to "echo $language[1]" (1 being the list item I altered) and it output only the item that I changed and allowed me to pass the section.
I was under the impression that the requested result was to output all items in the array, but they do seem to just want the altered item.

1232 points
Submitted by
Shelby Fried Rice
almost 3 years ago

0 votes


Same problem here. It was giving me a T-echo not expected error, so I checked the hint and seen that my code was perfectly fine. My code looked exactly like the code that was said to work above, but still broke and spit out an error. Strangely enough, I could submit it and I somehow passed the lesson.

149 points
Submitted by
ethanwdp Price
over 2 years ago