php 递归 返回数组

private function tree_data(&$list, $parent){
$tree = array();
foreach($list as $row) {
if($row['permission_parent_id'] == $parent) {

$row['children'] = $this->tree_data($list, $row['permission_id']);
$tree[] = $row;
}
}
return $tree;
}

posted on 2016-11-22 10:41  陈可  阅读(3422)  评论(0编辑  收藏  举报

导航