我有这样的输出:PHP循环多维关联数组
我没有任何想法,我怎样才能让我的数组是这样的:
$array[
0 => [
'item_id' => 6,
'price' => "2311.00",
'qty' => 12,
'discount' => 0
],
1 => [
'item_id' => 7,
'price' => "1231.00",
'qty' => 1,
'discount' => 12
],
2 => [
'item_id' => 8,
'price' => "123896.00",
'qty' => 0,
'discount' => 24
]
]
我已经开始了循环,但我真的不知道如何得到这种结构。
foreach($array as $wishlist){
foreach($wishlist as $k => $v){
}
}
显示'$ wishlist'内容 – RomanPerekhrest
该数组是屏幕截图。谢谢。 – Rbex