foreach($person as $k){
foreach($k as $key=>$value){
if(is_array($value)){
foreach($value as $kk=>$vv){
echo ' '.$kk.'-=-'.$vv.'';}
}else{
echo $key.'----'.$value.'';}
}
echo '====分割====';
}
foreach($person as $k){
foreach($k as $key=>$value){
if(is_array($value)){
foreach($value as $kk=>$vv){
echo ' '.$kk.'-=-'.$vv.'';}
}else{
echo $key.'----'.$value.'';}
}
echo '====分割====';
}
本文标题:php随记-foreach多维数组遍历
本文链接:https://www.haomeiwen.com/subject/vmisvttx.html
网友评论