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

Arrays Forum

View Course

866 points
55ffdac39113cba1dd0001e5_371075017
Submitted by
Reinhardt Rading
almost 2 years ago

its not working. arrays 6/7

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

      echo $languages[1];

    $languages [1] = "C++";
    echo $languages[1];
  ?>

3 votes

permalink

me now copy your code and delete line echo $languages[1];
and then working :D

349 points
8f98210bbd6d970148f4986865f6a271?s=140&d=retro
Submitted by
m.d.n.k
almost 2 years ago

2 Comments

55ffdac39113cba1dd0001e5_371075017 Reinhardt Rading almost 2 years ago

Thanks.

A7b3df099e4d00bb6f3ba745478c3f2f?s=140&d=retro joelmomanyi over 1 year ago

thanks i was also stuck


0 votes

permalink

Try this code.

<?php
$languages = array("HTML/CSS",
"JavaScript", "PHP", "Python", "Ruby");
$languages[2] = "C++";
echo $languages[2]
?>

It's just because " echo $languages[1] " it prints the javascript the moment you try to change the array.

226 points
C137547e697fccca4783eef6a007499c?s=140&d=retro
Submitted by
Venkata Rajesh
almost 2 years ago