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中如何为函数设置默认参数值
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn