php简单的数组递归
程序员文章站
2022-05-08 19:15:16
...
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);
下一篇: Yii快速入门(一)基本概念