如何在这个数组中打印出“id”?

这个问题可能早先被问过。我将不胜感激答案以及对先前提出的问题的指南(如果存在)。


array:3 [▼

"027c91341fd5cf4d2579b49c4b6a90da" => array:9 [▼

"rowId" => "027c91341fd5cf4d2579b49c4b6a90da"

"id" => "1"

"name" => "ks"

"qty" => "2"

"price" => 500.0

"options" => []

"tax" => "105.00"

"isSaved" => false

"subtotal" => "1000.00"

]

"370d08585360f5c568b18d1f2e4ca1df" => array:9 [▼

"rowId" => "370d08585360f5c568b18d1f2e4ca1df"

"id" => "2"

"name" => "clear glass"

"qty" => "2"

"price" => 500.0

"options" => []

"tax" => "105.00"

"isSaved" => false

"subtotal" => "1000.00"

]


"efb26e2c6ab6bd4d1323288923522d4e" => array:9 [▼

"rowId" => "efb26e2c6ab6bd4d1323288923522d4e"

"id" => "4"

"name" => "Double wall glass"

"qty" => 1

"price" => 34.0

"options" => []

"tax" => "7.14"

"isSaved" => false

"subtotal" => "34.00"

]

]

我如何打印 id , name , qty ...?


红糖糍粑
浏览 106回答 1
1回答

元芳怎么了

阅读文档中的多维数组。这是一个提示:foreach&nbsp;($array&nbsp;as&nbsp;$key&nbsp;=>&nbsp;$value)&nbsp;{&nbsp; &nbsp;&nbsp;&nbsp;echo&nbsp;$value['id'].'<br/>'; }
打开App,查看更多内容
随时随地看视频慕课网APP