Lets say I have
<?php
$type[ford][focus] = 'some text';
$type[ford][fiesta] = 'some text';
$type[toyota][corola] = 'some text';
$type[toyota][avensis] = 'some text';
$type[bmw][x6] = 'some text';
$type[bmw][x5] = 'some text';
$type[audi][a6] = 'some text';
$type[audi][a8] = 'some text';
function show($car){
foreach ($car as $model)
{
echo $model;
}
}
echo 'Best cars';
show ( $type[bmw] );
echo 'Other cars';
show ( $type[ford] );
?>
What I need is that the rest of cars that are not used (audi and toyota) to be displayed in the last function. So show ( $type[ford] ) should display ford, audi and toyota cars.
Thank you in advance.
I’m making a copy of the original variable here, but you can modify the original too if it’s not used anymore after this.