最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
无限分类php 递归函数
时间:2022-06-24 19:08:59 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
function createsortoptions ($selected=0,$parent_id=0,$n=-1) { global $db; $sql = "select * from `@__article_sort` where `parent_id` = '{$parent_id}'"; $options = "; static $i = 0; if ($i == 0) { $options .= ' if ($row['sort_id'] == $selected) { $options .=' selected '; } $options .=">".str_repeat(' ',$n*3).$row['sort_name']." "; $options .=createsortoptions ($selected,$row['sort_id'],$n); } } return $options; } |
如果是用smarty模板的朋友可以如下调用
代码如下 | 复制代码 |
//– $tpl->assign('sort_list',createsortoptions ()); //– $tpl->assign('sort_list',createsortoptions ($sort_id)); |
相关文章
- 原神千星奇域进入位置 10-14
- 蜘蛛纸牌网页版入口 无需下载注册点击秒玩 10-14
- 纸房子游戏安装入口 steam正版纸房子购买链接 10-14
- 原神云游戏官网入口 云原神网页版在线地址 10-14
- 我的花园世界最新兑换码分享 我的花园世界白嫖VIP方法介绍 10-14
- 荒野大镖客2作弊码有哪些 全作弊代码大全一览 10-14