tp循环导航

浏览:1361 发布日期:2015/05/02 分类:求助交流
请大家帮我看看,为什么循环输出时,结果没有$level
//组合一维数组
static public function wuxian($data,$html='——',$pid=0,$level=0){
$arr = array();
foreach($data as $v){
if($v['pid'] == $pid){
$V['level'] = $level + 1;
$v['html'] = str_repeat($html,$level);
$arr[] = $v;
$arr = array_merge($arr,self::wuxian($data,$html,$v['id'],$level+1));
}
}
return $arr;
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>