beescms相关函数学习

//获取指定栏目的所有子栏目

//@param:$id(栏目ID)

function get_child_id($id){
  $arr='';
  $sql="select id from ".DB_PRE."category where cate_hide!=1 and cate_parent=".intval($id);
  $child=$GLOBALS['mysql']->fetch_asc($sql);
  if(empty($child)){
    return '';
  }else{
    foreach($child as $k=>$v){
      $arr.=",".$v['id'];
      $arr.=get_child_id($v['id']);
    }
  unset($child);
  return $arr;
  }
}

原文地址:https://www.cnblogs.com/runong/p/3529392.html