我有2個數組,一個帶有鍵,另一個帶有數字鍵,我如何複製它們的鍵,以正確的順序替換數字鍵?將陣列密鑰複製到另一個現有陣列密鑰
陣列與數字鍵
Array
(
[0] => ABCDEFG
[1] => This is my description
[2] => 12.00
[3] => 30.00
[4] => My supplier
[5] => My brand
[6] => Shoes
[7] =>
)
陣列2
Array
(
[productcode] => Product Code
[productitemdesc] => Description
[retailsalesprice] => Selling Price
[currentcost] => Unit Cost
[supplier] => Supplier
[productbrand] => Brand
[productcategory] => Category
[productgroup] => Group
)
我希望這樣的事情
Array
(
[productcode] => ABCDEFG
[productitemdesc] => This is my description
[retailsalesprice] => 12.00
[currentcost] => 30.00
[supplier] => My Supplier
[productbrand] => My Brand
[productcategory] => Shoes
[productgroup] =>
)
是否有任何現有的功能,可用於PHP?試過array_fill_keys,但似乎並不是我想要的。
什麼是反對票? LOL –