首页 > 其他 > 详细

递归根据父ID 找所有子类ID

时间:2016-03-27 23:49:17      阅读:347      评论:0      收藏:0      [点我收藏+]
function getinfo($pid){
    $str = ‘‘;
    $row = M(‘user‘)->where(array(‘pid‘=>$pid))->select();
    if($row){
        foreach($row as $key => $val ){
            $str .= ‘,‘.$val[‘id‘];
            $str .= getinfo($val[‘id‘]);
        }
    }
    return $str;
}

 

递归根据父ID 找所有子类ID

原文:http://www.cnblogs.com/finnlee/p/5327221.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!