当前位置:网站首页>递归方法 rbac菜单层级显示 无限极分类
递归方法 rbac菜单层级显示 无限极分类
2022-06-29 08:17:00 【amateur12】
递归:自己调用自己,并且有一个递归出口,即结束递归
function rbac($node,$pid=0,$level=1)
{
static $arr = [];
foreach ($node as $val) {
if ($val['pid'] == $pid) {
$val['level'] = $level;
$arr[] = $val;
rbac($node, $val['nid'], $level + 1);
}
}
return $arr;
}边栏推荐
- Typescript variable declaration - type assertion
- 批量处理实验接触角数据-MATLAB分析
- The return values of hostname -f and uname -n may be different
- NLP标注工具:Label Studio实现多用户协作打标
- 对话| 数字时代,隐私计算的发展前景与挑战
- [hcie TAC] question 5-2
- Np5 formatted output (III)
- Huawei equipment is configured with medium-sized network WLAN basic services
- Write time replication of hugetlbfs
- Wallpaper applet source code double ended wechat Tiktok applet
猜你喜欢

Core development board & debugger

The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion

Swift中@dynamicMemberLookup和callAsFunction特性实现对象透明代理功能

ThreadLocal线程变量
![[redis] redis6 learning framework ideas and details](/img/64/836b1f8843a8eb91ff8da8c05ccd87.png)
[redis] redis6 learning framework ideas and details

重磅发布 | 《FISCO BCOS应用落地指南》

51单片机中断与定时器计数器,基于普中科技HC6800-ESV2.0
开发小技巧-图片资源管理

Baodawei of the people's Chain: break down barriers and establish a global data governance sharing and application platform

【Redis】Redis6学习框架思路和细节
随机推荐
Measure the level of various chess playing activities through ELO mechanism
2022春夏系列 KOREANO ESSENTIAL重塑时装生命力
Huawei equipment is configured with medium-sized network WLAN basic services
【微服务|OpenFeign】openfeign的超时时间
[microservices openfeign] timeout of openfeign
2022第六季完美童模 合肥賽區 决賽圓滿落幕
2022年7月系统集成项目管理工程师认证招生简章
城通网盘仿蓝奏网盘源码 附带视频教程
表格背单词的方法
MQTT第二话 -- emqx高可用集群实现
【无标题】
PaddleNLP通用信息抽取模型:UIE【信息抽取{实体关系抽取、中文分词、精准实体标。情感分析等}、文本纠错、问答系统、闲聊机器人、定制训练】
Write time replication of hugetlbfs
二手交易平台碳减排,有了评估标准
NP3 格式化输出(一)
对比HomeKit、米家,智汀家庭云版有哪些场景化的体验
Debugging nocturnal simulator with ADB command
NLP标注工具:Label Studio实现多用户协作打标
各種級數(調和、幾何)總結
P6776-[noi2020] surreal tree