您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

循环递归-数组,循环递归数组_PHP教程

2026/2/6 14:16:00发布11次查看
循环递归-数组,循环递归数组 private function fndotoarea($oid){
$oid = $this->chtid($oid);
$arrtaff = array();
$arrt =array();
$arrr = array();
foreach($this->select(select areaname , tid from otoarea where oid = '.$oid.' ) as $ks){
$arrr= array(node=>$ks[areaname],value=>$ks[tid]);
foreach ($this->select(select areaname , tid from otoarea where oid = '.$ks[tid].' ) as $kr){
$arrr['nodes'][] = array(node=>$kr[areaname],value=>$kr[tid]);
}
$nodes = $this->fndotoarea($ks[tid]);
if(!empty($nodes)){
$arrr[nodes] = $nodes;
}
array_push($arrtaff, $arrr);
}
return $arrtaff;
}
/*-------------------------------------------------------------*/
private function fndotoarea($oid){
$oid = $this->chtid($oid);
$arrtaff = array();
$arrt =array();
$arrr = array();
foreach($this->select(select areaname , tid from otoarea where oid = '.$oid.' ) as $ks){
$arrr= array(node=>$ks[areaname],value=>$ks[tid]);
foreach ($this->select(select areaname , tid from otoarea where oid = '.$ks[tid].' ) as $kr){
$arrr['nodes'][] = array(node=>$kr[areaname],value=>$kr[tid]);
}
$nodes = $this->fndotoarea($ks[tid]);
if(!empty($nodes)){
$arrr[nodes] = $nodes;
}
array_push($arrtaff, $arrr);
}
return $arrtaff;
}
http://www.bkjia.com/phpjc/927468.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/927468.htmltecharticle循环递归-数组,循环递归数组 private function fndotoarea($oid){ $oid = $this-chtid($oid); $arrtaff = array(); $arrt =array(); $arrr = array(); foreach($this-select(sel...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product