6/7 modifying array elements

    <title>Modifying Elements</title>
        $languages = array("HTML/CSS",
        "JavaScript", "PHP", "Python", "Ruby");
        echo $languages[1];
        // javascript
          $languages[1] = "php";
        echo $languages[1];

i dont understand whats wrong it say that i need to print the modified element.


Try removing the above so the code has only the two lines,

   $languages[1] = "php";
    echo $languages[1];


thank you it worked



Thanks it worked for me.


A post was split to a new topic: Output is showing JavaScriptphp


Thank you Mtf :smiley: it really did help alot but i need to stop looking for the solutions when i get stuck (this one i was stuck for a week on so thanks) :).


Submitted by
about 1 year ago

BUG: Instruction 2 is incorrect

Instruction 2 asks us to "use echo to output $languages" when the exercise actually wants us to output $languages[x] (where x is the index of the array element we have changed).

(Sorry this is not a question, I just wanted to provide feedback)

Me too, but I see it was provided "about 1 year ago" and is still wrong....