Mysql
 sql >> Database >  >> RDS >> Mysql

Come fare eco alle coppie chiave:valore di un sottoarray? PHP

foreach($animals['insect'] as $Mkey => $species) {
    echo "$Mkey : $species<br>";
}

// dynamic key:    
$key = 'insect';
foreach($animals[$key] as $Mkey => $species) {
    echo "$key: $Mkey : $species<br>";
}