$transport = array(
"Car" => array('Volvo','BMW','Saab','Land Roover'),
array("Air Plane"),
"Boat" => array('Ship','Yacht','Sail Boat'),
array("Bicycle")
);
print_r($transport);
echo "<br/><br/><br/><br/>";
How can I write a function that will turn array $transport into array $transport_in_array?
The goal is to wrap all elements of $transport inside an array so that the $transport_in_array becomes indexed.
$transport_in_array = array(
array("Car" => array('Volvo','BMW','Saab','Land Roover')),
array("Air Plane"),
array("Boat" => array('Ship','Yacht','Sail Boat')),
array("Bicycle")
);
print_r($transport_in_array);
$transportis indexed, it just has mixed key types.