I am a complete beginner so I need help.
I have the following code:
[php]
$foodprices = array(“vegetables”=>array(“Tomatoes”=>1.00, “Beet”=>20.5, “Onions”=>3.5),
“Meat”=>array(“Skaap”=>20.5, “Bees”=>30.5));
var_dump($foodprices);
foreach($foodprices as $category)
{
echo “The current category is $category”;
foreach($category as $food => $price)
{
echo “
The price of {$food} is {$price}”;
}
}
[/php]
I would like to print the category names as well so how do I print the key values of a multidimensional array please. Any help is appreciated