如题所述
第1个回答 2020-11-10
$myArr=array("fruit"=>array("apple","orange","grape"),"animal"=>array("dog","pig","cat"));
foreach($myArr as $key=>$val) {
echo $key.":";
foreach($val as $index=>$content) {
echo $content." ";
}
echo "<br/>";
}
foreach($myArr as $key=>$val) {
echo $key.":";
foreach($val as $index=>$content) {
echo $content." ";
}
echo "<br/>";
}