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

Arrays Forum

View Course » View Exercise

89 points
6a88a0120a06b9f74f10220cd5cd7db7?s=140&d=retro
Submitted by
Universal Guy
over 2 years ago

bug found in the site! My code wasn't working

this is my code.you guys want me to output $languages but first modify it so here i have done the exact thing but my code doesn't work please help.
my code is here :
<?php
$languages = array("HTML/CSS","JavaScript", "PHP", "Python", "Ruby");
echo $languages[3];
$languages[3] = "c++"; // Write the code to modify
echo $languages[3]; // the $languages array!

  ?>

0 votes

permalink

This has just happened to me too. It's not working.... Please help us to solve this problem!
Here is my code:
<?php
$languages = array("HTML/CSS",
"JavaScript", "PHP", "Python", "Ruby");

    echo $languages{1}

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

    $languages{1} = "C++";

    echo $languages{1};

  ?>

78 points
26be82bf75c654378f95f6b38fa3a3e6?s=140&d=retro
Submitted by
PhptheCode
over 2 years ago

3 Comments

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

remove the first $languages {1} then it will work it worked for me =D

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

sorry remove the first echo $languages{1} then it should work fine

Ba2be097b0818ab40d5e43f55e9ac214?s=140&d=retro kim_limaa about 2 years ago

Thank you, worked to me!


0 votes

permalink

It worked for me too! Thank you so much :)

78 points
26be82bf75c654378f95f6b38fa3a3e6?s=140&d=retro
Submitted by
PhptheCode
over 2 years ago