我想将下面的数组转换为更简单的数据,以便更容易理解。我只是展示第一个配对的方式有不止一个订单,因为它已经太长了。
Array
(
[0] => Array
(
[no] => 1
[FL] => Array
(
[0] => Array
(
[val] => ORDERID
[content] => 2244668800
)
[1] => Array
(
[val] => Account Name
[content] => John Doe
)
[3] => Array
(
[val] => Product Details
[product] => Array
(
[0] => Array
(
[no] => 1
[FL] => Array
(
[0] => Array
(
[val] => Product Id
[content] => 1122334455
)
[1] => Array
(
[val] => Product Name
[content] => Samsung Monitor
)
)
)
[1] => Array
(
[no] => 2
[FL] => Array
(
[0] => Array
(
[val] => Product Id
[content] => 1122334456
)
[1] => Array
(
[val] => Product Name
[content] => Fractal Case
)
)
)
)
)
)
)
)
我希望它是这样的。
[0] => Array(
'orderid' => '2244668800',
'accountname' => 'John Doe',
'monitorproductid' => '1122334455',
'monitor' => 'Samsung Monitor',
'caseproductid' => '1122334456',
'case' => 'Fractal Case'
)
获取orderid
和accountname
没问题,但老实说我遇到monitorproductid
,monitor
,caseproductid
,{{1}的问题}
我正在使用foreach来获取case
和orderid
这样的内容。
accountname
提前感谢你们。我是多维数组的新手。我查看过不同的网站,但找不到类似的情况。