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;
}
Copy after login
Articles you may be interested in
- php function to extract the birthday date from the ID number and verify whether it is a minor
- XDebug The progress bar stops at 57%, prompting the solution to the waiting for XDebug session error
- Introduction to the union, intersection and difference functions of arrays in php
- The most accurate string length interception function in php
- Fatal error Class 'SoapClient' not found in ... Error handling method
- Fatal error Class 'ZipArchive' not found ... Solution
- PHP number judgment function
- How to set default parameter values for functions in Javascript
http://www.bkjia.com/PHPjc/764198.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764198.htmlTechArticlefunction 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_P...