请问这段代码需要怎么理解

浏览:271 发布日期:2017/02/16 分类:求助交流 关键字: tp5
请问这段代码需要怎么理解,getchilrenid ,_getchilrenid 是什么意思public function getchilrenid($cateid){
        $cateres=$this->select();
        $arr=$this->_getchilrenid($cateres,$cateid);
        $arr[]=$cateid;
        $strId=implode(',', $arr);
        return $strId;
    }


public function _getchilrenid($cateres,$cateid){
        static $arr=array();
        foreach ($cateres as $k => $v) {
            if($v['pid'] == $cateid){
                $arr[]=$v['id'];
                $this->_getchilrenid($cateres,$v['id']);
            }
        }

        return $arr;
    }
最佳答案
评论( 相关
后面还有条评论,点击查看>>