我想將兩個數組與一個公共列組合。但是,並沒有得到我想要的。請檢查以下要求。PHP數組合並使用一列值
陣列1
Array
(
[0] => stdClass Object
(
[fieldLabel] => fname
[uuid] => 27478
)
[1] => stdClass Object
(
[fieldLabel] => Lname
[uuid] => 6103
)
[2] => stdClass Object
(
[fieldLabel] => Country
[uuid] => 7350
)
[3] => stdClass Object
(
[fieldLabel] => check1
[uuid] => 23155
)
[4] => stdClass Object
(
[fieldLabel] => radio1
[uuid] => 15664
)
)
陣列2
Array
(
[0] => stdClass Object
(
[uuid] => 27478
[value] => sai1
)
[1] => stdClass Object
(
[uuid] => 6103
[value] => sai2
)
[2] => stdClass Object
(
[uuid] => 7350
[value] => USA
)
[3] => stdClass Object
(
[uuid] => 23155
[value] => USA|India
)
)
我需要像下面輸出。這兩個數組的'UUID'是很常見的。如果第二個數組中的值不存在,它應該是空的。
陣列 ( [0] => stdClass的對象 ( [FieldLabel聯合] => FNAME [UUID] => 27478 [值] => SAI1 )
[1] => stdClass Object
(
[fieldLabel] => Lname
[uuid] => 6103
[value] =>sai2
)
[2] => stdClass Object
(
[fieldLabel] => Country
[uuid] => 7350
[value] =>USA
)
[3] => stdClass Object
(
[fieldLabel] => check1
[uuid] => 23155
[value] =>USA|India
)
[4] => stdClass Object
(
[fieldLabel] => radio1
[uuid] => 15664
)
)
請提供如何才能實現
請分享你已經試過的東西。 –