PHP递归小例子
$news = M('productbase'); function digui($idd){ $child=M('navclass')->where('f_id='.$idd)->select(); // print_r($child); if(!empty($child)){ foreach($child as $v){ echo $v['id']."<br/>"; digui($v['id']); } } } digui($id);
$news = M('productbase'); function digui($idd){ $child=M('navclass')->where('f_id='.$idd)->select(); // print_r($child); if(!empty($child)){ foreach($child as $v){ echo $v['id']."<br/>"; digui($v['id']); } } } digui($id);