function _findChildren($list, $p_id){ //数据层级化,
$r = array();
foreach($list as $id=>$item){
if($item['parent_id'] == $p_id) {
$length = count($r);
$r[$length] = $item;
if($t = $this->_findChildren($list, $item['id']) ){
$r[$length]['children'] = $t;
}
}
}
return $r;
}
print_r(_findChildren($mylist, 0));
已抢111452个
抢已抢47275个
抢已抢133909个
抢已抢32466个
抢已抢345个
抢已抢809个
抢