标签:div return [] size 分类 turn cti cat style
public function tree($data,$parent_id = 0,$leave = 0)
{
static $tree = array();
foreach($data as $k => $v){
if($v[‘parent_id‘] == $parent_id){
$v[‘leave‘] = $leave;
$tree[] = $v;
$this->tree($data,$v[‘cat_id‘],$leave+1);
}
}
return $tree;
}
标签:div return [] size 分类 turn cti cat style
原文地址:http://www.cnblogs.com/cnn2017/p/6862173.html