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

Arrays Forum

View Course » View Exercise

249 points
0a03e87782410543d967cd990554f4aa?s=140&d=retro
Submitted by
Eliezer Alter
about 2 years ago

6/7

Below is my code & I would like to please know as to what I did wrong as its not working.

Modifying Elements



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

   $languages[1] = "C++";
   echo $language [1];
  ?>
</p>

4 votes

permalink

Changing all the values in the array works for me:

<html>
  <head>
    <title>Modifying Elements</title>
  </head>
  <body>
    <p>
  <?php
    $languages = array("HTML/CSS",
    "JavaScript", "PHP", "Python", "Ruby");
    $languages[0] = "tst0";
    $languages[1] = "tst1";
    $languages[2] = "tst2";
    $languages[3] = "tst3";
    $languages[4] = "tst4";

    echo $languages[0];
    echo $languages[1];
    echo $languages[2];
    echo $languages[3];
    echo $languages[4];

  ?>
</p>

1094 points
Picture
Submitted by
Wesley Maurmair
about 2 years ago


0 votes

permalink

you`re echo is not displayed. you have wrote language and not languages as the variable is :)

38 points
35753af88464a56bd99710829a5181dc?s=140&d=retro
Submitted by
laura_ice
almost 2 years ago