title: PHP: Foreach in a multidimensional array
body: <p>Got an assignment for school to make a multidimensional array.</p>
  
  <pre><code>&lt;?php
  $cars = array( 
          "car1" =&gt; array (   
              "brand" =&gt; 'BMW',
              "license" =&gt; '30-KL-PO',    
              "price" =&gt; 10000
              ),
  
          "car2" =&gt; array (
             "brand" =&gt; 'Mercedes',
             "license" =&gt; '51-ZD-ZD',
             "price" =&gt; 20000
          ),
  
          "car3" =&gt; array (
             "brand" =&gt; 'Maserati',
             "license" =&gt; 'JB-47-02',
             "price" =&gt; 30000
          )
       );
  
  foreach($carss as $car){
  echo $car['car1']['brand'] . $car['car1']['brand'] . "&lt;br&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>I need to show the brand and license of all the cars using a foreach. I tried it with only car1 and I got the error: Undefined index: car1.</p>
  
  <p>I know how to get it to show using only echo but my assignment says that I have to using a foreach.</p>