我有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 –