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

Arrays Forum

View Course » View Exercise

374 points
54bd518576b8fe26ea000070_273200774
Submitted by
KimMoon
over 2 years ago

Arrays 6/7 - The instructions are incorrect!

The instructions say to echo $languages which should mean they want the entire array to print out. The instructions don't say to echo the changed item in the array which is what they're looking for.


2 votes

permalink

remove the first echo. then the code will run! :)

38 points
59a8cde90227a5ccc0aaf42f4e25bf43?s=140&d=retro
Submitted by
natedecocow
over 2 years ago

1 Comment

Picture Jefrerey Arias Sr. over 2 years ago

thanks for clearing this up


2 votes

permalink

but there is only 1/one echo ha ha

666 points
Picture
Submitted by
Tomer Neeman
over 2 years ago


2 votes

permalink

It should look something like this after removing the first line of echo $languages....

$languages = array("HTML/CSS",
    "JavaScript", "PHP", "Python", "Ruby");

    $languages[2] = "NOOOOO";

    echo $languages[2];

95 points
D336e0553c1acea3a264802478afe633?s=140&d=retro
Submitted by
vang0887
over 2 years ago

1 Comment

6a88a0120a06b9f74f10220cd5cd7db7?s=140&d=retro Universal Guy over 2 years ago

Thanks bro it worked but this is a bug right?


0 votes

permalink

Yea. This one is confusing...

262 points
Picture
Submitted by
Justin Macri
over 2 years ago


0 votes

permalink

It is telling me that the code below is printing out 'PHP', which isn't correct.
It prints out "PHP? Hey Jack, what does PHP stand for?" but it wouldn't count it as correct.

    $languages = array("HTML/CSS",
    "JavaScript", "PHP", "Python", "Ruby");

    $languages[2] = "PHP? Hey Jack, what does PHP stand for?";
    echo $languages[2];

421 points
98113b959fa08b14f7aadd086f7a6967?s=140&d=retro
Submitted by
kamal al-din
over 2 years ago


0 votes

permalink

Arrays 6/7
where is my mistake?
screenshot -> http://failiem.lv/u/thnhlkt#

~if I delete the first echo, there still remains the same error/problem

209 points
Picture
Submitted by
Kaspars Zukovs
over 2 years ago

1 Comment

5674c6dae39efec455000434_879409444 Zeke Y over 2 years ago

You need to echo languages, not myArray. Also, the new line inside the languages array shouldn't be there.


0 votes

permalink

If you just modify the first item in the array it works (i.e. 0)

1382 points
31bbed90ba89306cdc154287125e18ab?s=140&d=retro
Submitted by
kro7819
over 2 years ago


-1 votes

permalink

This will also work in this course

<?php
$languages = array("HTML/CSS",
"JavaScript", "", "Python", "Ruby");

    echo $languages[2];

    $languages[2] = "Pearl";

    echo $languages[2];

    // Write the code to modify
    // the $languages array!

  ?>

218 points
Picture
Submitted by
Christian Nielsen
over 2 years ago


-3 votes

permalink

Modifying Elements



<?php
$languages = array("HTML/CSS",
"JavaScript", "PHP", "Python", "Ruby");
$languages[3]!="Python";
$languages[3];

    $languages[3]="java";

    echo $languages[3];

    // Write the code to modify
    // the $languages array!

  ?>
</p>

195 points
Picture
Submitted by
Vishal Kumar Verma
over 2 years ago