Home > php教程 > php手册 > 获取子class_id集合的函数

获取子class_id集合的函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 09:36:07
Original
829 people have browsed it

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

 

您可能感兴趣的文章

  • php提取身份证号码中的生日日期以及验证是否为未成年人的函数
  • XDebug的进度条停在57%,提示waiting for XDebug session错误的解决办法
  • php中数组的并集、交集和差集函数介绍
  • php最精确的字符串长度截取函数
  • Fatal error Class 'SoapClient' not found in ...错误处理办法
  • Fatal error Class 'ZipArchive' not found ...... 的解决办法
  • PHP数字判断函数
  • Javascript中如何为函数设置默认参数值
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template