我有一个多维数组,它给了我这个:
[ShipmentServiceLevelCategory] => test
[OrderTotal] => Array
(
[Amount] => 11.11
[CurrencyCode] => GBP
)
[ShipServiceLevel] => Std UK Dom
[MarketplaceId] => test
[ShippingAddress] => Array
(
[Phone] => 123213213213
[PostalCode] => TES T12
[Name] => Test
[CountryCode] => GB
[StateOrRegion] => Test
[AddressLine1] => Test
[City] => Test
)
我想将此信息插入到我的数据库中,但我的列名与数组键不同,因此我试图创建另一个包含键映射的数组。这是我到目前为止所尝试的:
$map = array('ShippingAddress['Phone']' => 'DEL_PHONE','ShippingAddress['PostalCode']'=> 'DEL_POSTCODE','ShippingAddress['Name']' => 'DEL_NAME');
但是,这给了我一个语法错误,有人可以指出我在哪里出错了吗?