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

Arrays Forum

View Course » View Exercise

571 points
B39b8daf069964b56c5e3937b378910c?s=140&d=retro
Submitted by
Alex Beyer
over 3 years ago

Make your rules clear for lessons!!!!

Rules/Requirements:

  1. Change an item in the $languages array. You can take your pick!
  2. Then use echo to output $languages.

My Code:

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

   $languages[0] = "SQL";
   echo $languages[0];
   echo $languages[1];
   echo $languages[2];
   echo $languages[3];
   echo $languages[4];
  ?>

I copied the rules for the lesson as they were, it says change an item, an=1 not all 5 so when I hit "submit", I get an error saying that "JavaScript" hasn't been changed. I then added 2 more changes at random position and still not enough. Is it one item or change all of them? If you're writing a lesson make your rules/requirements clear.


0 votes

permalink

I did $languages[2] = "PeeEightsPee;
ans it worked tbh :$ :o

450 points
5240e713abf821aa28001257_703076796
Submitted by
Robinvb
over 3 years ago

1 Comment

544969e68c1ccced9d000ff6_703460878 malfy almost 3 years ago

That's not what the issue is. Just changing 1 of the array elements is obvious. But step 2 in the instructions says "Then use echo to output $languages." When what it ACTUALLY want you to do is echo $languages[2]