Assassins creed is printed to the page but apparently it hasn't. HELP


Oops, try again. It looks like 'AssasinsCreed' is part of $myArray, but it wasn't printed to the page!

      // On the line below, create your own associative array:
      $myArray = array("Assasins Creed", "Mafia", "Call of Duty");

      // On the line below, output one of the values to the page:
     echo $myArray[1];      
     echo '<br />';
      // On the line below, loop through the array and output
      // *all* of the values to the page:
     foreach($myArray as $value) {
         echo "$value <br>";  


Yours is not an associative array, but an ordered array. Following is an example of an associative array...

$myArray = array('Van'=>'Canucks','Calg'=>'Flames','Edm'=>'Oilers');

$key => $value


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.