$shop = array(
array("Rose", 1.25 , 15),
array("Daisy", 0.75 , 25),
array("Orchid", 1.15 , 7)
);
for($i = 0; $i <= count($shop); $i++){
foreach($shop[$i] as $key => $val)
echo $key . ' = ' . $val . '<br>';
}
So this is the output I'm getting:
0 = Rose
1 = 1.25
2 = 15
0 = Daisy
1 = 0.75
2 = 25
0 = Orchid
1 = 1.15
2 = 7
============================================
But then I get an error:
Warning: Invalid argument supplied for foreach()
What I want to know is how to correct this, and if there's a more efficient way to write what I'm trying to output?
Thanks guys.