php简单的数组递归
程序员文章站
2022-06-03 18:30:08
...
php代码
function a($arr){ if(!is_array($arr)){ echo $arr."\n"; }else foreach($arr as $v){ if(is_array($v)){ foreach($v as $vv){ echo a($vv)."\n"; } }else{ echo $v."\n"; } } } $a=array("dasfd",array("aaa","bbb"),3,4,array("mickelfeng123",array(34,"mickelfeng","mickelfenghello"))); a($a);