ThinkPHP双重循环遍历输出
数据表1 Cat 栏目
数据表2 In 文章
$cat= D("Cat");
$in = D("In");$total = $cat -> select();foreach($total as $k => $v){
$total[$k]['new'] =$in -> where(array('cat_title' => $v['cat_title'])) -> limit(10) -> select();
}$this -> assign('total',$total);
view页面
- {$v.cat_title}
- {$vo.in_title} {$vo.in_tm}

本文讲解了ThinkPHP 双重循环遍历输出 的相关内容,更多相关内容请关注php中文网。
相关推荐:
立即学习“PHP免费学习笔记(深入)”;











