Modifying Array Elements PHP (Codeacademy)

The correct code for “Modifying array elemtns”.

1
2
3
4
5
6
7
8
9
10
11
12
<?php
        $languages = array("HTML/CSS",
        "JavaScript", "PHP", "Python", "Ruby");
 
        $languages[0] = "test";
 
        // Write the code to modify
        // the $languages array!
 
        echo $languages[0];
 
      ?>

It should display “test” in the result screen.

ADD A COMMENT: