请教一下数组处理问题

浏览:165 发布日期:2022/11/14 分类:求助交流 关键字: 数组处理 数组
Array
(
[0] => Array
(
[id] => 1
[phone] => 13880613626
[pid] => 0
)

[1] => Array
(
[id] => 94
[phone] => 13681000688
[pid] => 0
)

[2] => Array
(
[id] => 95
[phone] => 13666085712
[pid] => 94
)

[3] => Array
(
[id] => 97
[phone] => 13666085711
[pid] => 1
)
...
)

改成

Array
(
[0] => Array
(
[id] => 1
[phone] => 13880613626
[pid] => 0
[p_phone] => 0
)

[1] => Array
(
[id] => 94
[phone] => 13681000688
[pid] => 0
[p_phone] => 0
)

[2] => Array
(
[id] => 95
[phone] => 13666085712
[pid] => 94
[p_phone] => 13681000688
)

[3] => Array
(
[id] => 97
[phone] => 13666085711
[pid] => 1
[p_phone] => 13880613626
)
...
)


根据pid查找出同数组对应的电话,然后添加到对应数组的键值里。
最佳答案
评论( 相关
后面还有条评论,点击查看>>