<?php
error_reporting(E_ALL);
$movies = array(
  array(
    "title" => "Rear Window",
    "director" => "Alfred Hitchcock",
    "year" => 1954
  ),
  array(
    "title" => "Full Metal Jacket",
    "director" => "Stanley Kubrick",
    "year" => 1987
  ),
  array(
    "title" => "Mean Streets",
    "director" => "Martin Scorsese",
    "year" => 1973
  )
);

for ($i=0;$i<count($movies);$i++){
    foreach ($movies[$i] as $key=>$value){
        echo ucfirst($key).':  '.$value.'<br>';
    }
}

foreach ($movies as $value){
    foreach ($value as $key=>$innervalue){
        echo ucfirst($key).':  '.$innervalue.'<br>';
    }
}




//output the entire db like the folllowing:
/*
Title: 
Director:
Year:
*/
var_dump($movies[0]);
echo $movies;
echo '<pre>';
print_r($movies);
echo '</pre>';

//output the flower the price and the quantity output the total price if you can

$shop = array(array(array("rose", 1.25, 15),
                    array("daisy", 0.75, 25),
                    array("orchid", 1.15, 7) 
                   ),
              array(array("rose", 1.25, 15),
                    array("daisy", 0.75, 25),
                    array("orchid", 1.15, 7) 
                   ),
              array(array("rose", 1.25, 15),
                    array("daisy", 0.75, 25),
                    array("orchid", 1.15, 7) 
                   )
             );

for ($i=0;$i<count($shop);$i++){
    //outside loop...only one member right now...could change!
    for ($k=0;$k<count($shop[$i]);$k++){
        //middle loop...just an index array
        //var_dump($shop[$i][$k]);
           for ($l=0;$l<count($shop[$i][$k]);$l++){
               $price = $shop[$i][$k][1];
               $qty = $shop[$i][$k][2];
               
               $total = $price * $qty;
               //third level. This is where we get out goodies!!
              echo $shop[$i][$k][$l].'<br>';   
         }
        echo "Total is :$".$total;
        echo '<br><br>';
    }
}

