function get_bottom_class_id($class_id){
if(!isset($class_id) || !is_numeric($class_id)){
return false;
}
global $db;
static $class_id_array=array();
$sql="select `class_id` from `".TB_PREFIX."web_class` where `class_parent_id`='".$class_id."'";
$rows=$db->getRowsArray($sql,MYSQL_NUM);
if(!empty($rows) && is_array($rows)){
foreach($rows as $row){
get_bottom_class_id($row[0]);
}
}else{
$class_id_array[]=$class_id;
}
if(is_array($class_id_array)){
$class_id=implode(',',$class_id_array);
}else{
$class_id=$class_id_array;
}
return $class_id;
}
您可能感興趣的文章
- php提取身份證號碼中的生日日期以及驗證是否為未成年人的函數
- XDebug的進度條停在57%,提示waiting for XDebug session錯誤的解決辦法
- php中數組的並集、交集和差集函數介紹
- php最精確的字符串長度截取函數
- Fatal error Class 'SoapClient' not found in ...錯誤處理辦法
- Fatal error Class 'ZipArchive' not found ...... 的解決辦法
- PHP數字判斷函數
- Javascript中如何為函數設置默認參數值