日期:2014-05-16 浏览次数:20586 次
//用两个集合实现父子菜单的加载
foreach($vo as $key=>$value){
$vo[$key]['id']=$value['id'];
$vo[$key]['menuid']=$value['menuid'];
$vo[$key]['menuname']=$value['menuname'];
$vo[$key]['parentid']=$value['parentid'];
$vo[$key]['childid']=$value['childid'];
$vo[$key]['URL']=$value['URL'];
}
}
foreach($v1 as $key1=>$value1){
foreach($v2 as $key=>$value2){
if($key1+1>=count($vo)){
echo '1';
break;
}
if($v2[$key1+1]['parentid']==$vo[$key]['menuid']){
$vo[$key1+1]['parentid']=$value2['menuid'];
print_r($vo[$key+1]['parentid']);
}
}
}
dump($vo)