More Environment errors


#1

Doens't accept valid answer again...php advanced arrays lesson 2:

The following code gives me this error: "Oops, try again. It looks like you didn't add 'BMW' to the end of the regular array." (I dumped the array to show I did indeed add the element to the array) Code obviously compiles without errors and meets the instructional requirements. (???)

<html>
  <head>
    <title>Making the Connection</title>
  </head>
  <body>
    <p>
      <?php
        // This is an array using integers as the indices.
        // Add 'BMW' as the last element in the array!
        $car = array(2012, 'blue', 5);
        $car[3] = "BMW";
        var_dump($car);
    

        // This is an associative array.
        // Add the make => 'BMW' key/value pair!
        $assocCar = array('year' => 2012,
                   'colour' => 'blue',
                   'doors' => 5);
        $assocCar = array('make'  => 'BMW');
            
        // This code should output "BMW"...
        echo $car[3];
        echo '<br />';
            
        // ...and so should this!
        echo $assocCar['make'];
      ?>
    </p>
  </body>
</html>

CONTINUED ISSUES:
I am now on lesson 6, multidimensional arrays, which is a simple intro, add an element to the array to begin the new area of information...and for some reason, (because I did this task just like I added an element to the first array in lesson 2) it doesn't like "how" I am adding elements to the arrays, although it's legal, I checked. So question is, WHAT IS THE STUPID SYSTEM LOOKING FOR????? Here is my code for lesson 6:

<html>
  <head>
    <title>Blackjack!</title>
  </head>
  <body>
    <p>
      <?php
        $deck = array(array('2 of Diamonds', 2),
                      array('5 of Diamonds', 5),
                      array('7 of Diamonds', 7));
        $deck[3] = array('4 of spades', 4);
        
      // Imagine the first chosen card was the 7 of Diamonds.
      // This is how we would show the user what they have:
      echo 'You have the ' . $deck[3][0] . '!';
      ?>
    </p>
  </body>
</html>

I've done 4 lessons...an answer would be helpful. I hope to get my badges...


#2

Lesson 2:
You should add them as part of the code (write them in the array) and not in the form of a modification to the array.