当前位置:网站首页>递归方法 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;
}边栏推荐
- Measure the level of various chess playing activities through ELO mechanism
- 背包九讲——全篇详细理解与代码实现
- New spark in intelligent era: wireless irrigation with Lora wireless transmission technology
- ES6 data type map & set
- Standard | China payment and clearing Association releases the first privacy computing financial specification
- Intelligent hardware EVT DVT PVT mp
- Mutex mutex
- hugetlbfs的写时复制
- Message Oriented Middleware: pulsar
- 网上开股票账户真的安全吗?求答案
猜你喜欢

搭建开源物联网平台教程

Standard | China payment and clearing Association releases the first privacy computing financial specification

城通网盘仿蓝奏网盘源码 附带视频教程

首次触电,原来你是这样的龙蜥社区 | 龙蜥开发者说第8期

语音信号处理-基础(一):声学基础知识

一个高频问题,三种模型思维来破解此风控难题

51 MCU interrupt and timer counter, based on Puzhong technology hc6800-esv2.0

Interprocess communication (IPC)

x86和x64的区别

【微服务|OpenFeign】openfeign的超时时间
随机推荐
人民链鲍大伟:打破壁垒,建立全域数据治理共享及应用平台
A high-frequency problem, three kinds of model thinking to solve this risk control problem
How to gain profits from the operation of the points mall
PaddleNLP通用信息抽取模型:UIE【信息抽取{实体关系抽取、中文分词、精准实体标。情感分析等}、文本纠错、问答系统、闲聊机器人、定制训练】
各种级数(调和、几何)总结
Notes on key words in the original English work biography of jobs (VII) [chapter five]
Batch processing of experimental contact angle data matlab analysis
Measure the level of various chess playing activities through ELO mechanism
开户买基金,通过网上基金开户安全吗?-
语音标注自动音段对齐工具SPPAS使用笔记
名企实习一年要学会的15件事,这样你就省的走弯路了。
积分商城运营要如何做才能获取到利润
Does the SQL server run with administrator privileges? Or run it as a normal user?
2022 spring summer collection koreano essential reshapes the vitality of fashion
x86和x64的区别
Backpack Lecture 9 - detailed understanding and code implementation
TypeScript 变量声明 —— 类型断言
Write time replication of hugetlbfs
CDGA|交通行业做好数字化转型的核心是什么?
P6776-[NOI2020]超现实树