我想合併一個鍵內兩個鍵的兩個值。 數組是這樣的:如何將一個數組中的兩個鍵合併成一個鍵?
[PromotionIds] => Array (
[PromotionId] => Array (
[0] => Amazon PLCC Free-Financing Universal Merchant MP-rachmit-1507891499711
[1] => Amazon PLCC Free-Financing Universal Merchant Script-1507895115492
)
)
,但我想合併[0]
和[1]
鑰匙插入鑰匙[PromotionID]
:
[PromotionIds] => Array (
[PromotionId] => Amazon PLCC Free-Financing Universal Merchant MP-rachmit-1507891499711,Amazon PLCC Free-Financing Universal Merchant Script-1507895115492
)
試試Array_combine。 http://php.net/manual/en/function.array-combine.php – TarangP