ThinkPHP3.2.3 foreach嵌套循环bug

有两个数组authA和authB

authA如下

 1 Array
 2 (
 3     [0] => Array
 4         (
 5             [auth_id] => 1
 6             [auth_name] => 文章管理
 7             [auth_pid] => 0
 8             [auth_c] => 
 9             [auth_a] => 
10             [auth_level] => 0
11         )
12 
13     [1] => Array
14         (
15             [auth_id] => 4
16             [auth_name] => 系统设置
17             [auth_pid] => 0
18             [auth_c] => 
19             [auth_a] => 
20             [auth_level] => 0
21         )
22 
23 )

authB如下

 1 Array
 2 (
 3     [0] => Array
 4         (
 5             [auth_id] => 2
 6             [auth_name] => 文章列表
 7             [auth_pid] => 1
 8             [auth_c] => Article
 9             [auth_a] => index
10             [auth_level] => 1
11         )
12 
13     [1] => Array
14         (
15             [auth_id] => 3
16             [auth_name] => 添加文章
17             [auth_pid] => 1
18             [auth_c] => Article
19             [auth_a] => add
20             [auth_level] => 1
21         )
22 
23     [2] => Array
24         (
25             [auth_id] => 5
26             [auth_name] => 网站配置
27             [auth_pid] => 4
28             [auth_c] => Config
29             [auth_a] => index
30             [auth_level] => 1
31         )
32 
33     [3] => Array
34         (
35             [auth_id] => 6
36             [auth_name] => 网站备份
37             [auth_pid] => 4
38             [auth_c] => Config
39             [auth_a] => bak
40             [auth_level] => 1
41         )
42 
43 )

正确的循环代码是

 

若是把vv改成authB,则会出现bug

换成其他非authB则不会出现问题

 

转载于:https://www.cnblogs.com/lwn007/p/6562027.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值