foreach ($menus as $menus_v){ if ($menus_v['parent_id'] == 0) { $a[$menus_v['smid']] = $menus_v; } else{ // foreach ($$menus as $menus_v){ if($menus_v['parent_id'] != $menus_v['smid']){ $a[$menus_v['parent_id']]['children'][$menus_v['smid']] = $menus_v; } else { $b[[$menus_v['smid']][$menus_v['parent_id']]['children']] [] = $menus_v; } } } }
我这样写一直有问题