08 2022 档案

PHP使用递归深度合并多个数组,递归合并嵌套数组
摘要://导入待合并数组,引用$array数组接收 function merge(array &$array,array ...$mergeArray): array { foreach ($mergeArray as $item){ mergeOne($array,$item); //对每个待合并数组执 阅读全文

posted @ 2022-08-02 00:23 DreamOnTheGo 阅读(236) 评论(0) 推荐(0) 编辑

php数组通过递归转换成无限级树结构
摘要://id作为索引,pid 为父索引 function tree(&$list,$pid=0){ $tree=[]; foreach ($list as $key=>$item){ if ($item['pid'] $pid){ $tree[$item['id']]=$item; unset($lis 阅读全文

posted @ 2022-08-01 23:48 DreamOnTheGo 阅读(49) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示