php数组合并字段,PHP数组按要求合并

数组一:

[0] => Array

(

[rid] => 1

[hf_rid] => 0

[aid] => 1

[uid] => 1

[content] => 我肯定第一名

[re_time] => 2017-10-10 10:59

[nickname] => 就是这么帅

)

[1] => Array

(

[rid] => 2

[hf_rid] => 0

[aid] => 1

[uid] => 1

[content] => 马蛋,中枪了

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

)

数组二:

[0] => Array

(

[rid] => 3

[hf_rid] => 1

[aid] => 1

[uid] => 1

[content] => 我肯定第一名

[re_time] => 2017-10-10 10:59

[nickname] => 就是这么帅

)

[1] => Array

(

[rid] => 4

[hf_rid] => 2

[aid] => 1

[uid] => 1

[content] => 马蛋,中枪了

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

)

[2] => Array

(

[rid] => 5

[hf_rid] => 2

[aid] => 1

[uid] => 1

[content] => ssd发的发的服务

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

)

我想把他们合并起来!~具体合并要求是这样的: 如果数组二的hf_rid字段等于数组一的 rid 字段,那么合并的效果是这样的

[0] => Array

(

[rid] => 1

[hf_rid] => 0

[aid] => 1

[uid] => 1

[content] => 我肯定第一名

[re_time] => 2017-10-10 10:59

[nickname] => 就是这么帅

[xxxxx]=> Array

(

[rid] => 3

[hf_rid] => 1

[aid] => 1

[uid] => 1

[content] => 我肯定第一名

[re_time] => 2017-10-10 10:59

[nickname] => 就是这么帅

)

)

[1] => Array

(

[rid] => 2

[hf_rid] => 0

[aid] => 1

[uid] => 1

[content] => 马蛋,中枪了

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

[xxxxx]=> Array

(

[0]=>array

(

[rid] => 4

[hf_rid] => 2

[aid] => 1

[uid] => 1

[content] => 马蛋,中枪了

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

)

[1] => Array

(

[rid] => 5

[hf_rid] => 2

[aid] => 1

[uid] => 1

[content] => ssd发的发的服务

[re_time] => 2017-10-10 01:10

[nickname] => 说定的唉

)

)

)

求大神们伸出援助之手啊!!!阿门!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值