0

This question might have been asked earlier. I will appreciate an answer as well as a guide to previously asked questions if they exist.

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"
]
]

How do I print id , name, qty...?

N69S
  • 16,110
  • 3
  • 22
  • 36
davidkihara
  • 493
  • 1
  • 10
  • 30
  • just read php documentation. `echo $array['id'];` etc – N69S Jun 01 '20 at 12:47
  • Does this answer your question? [How to echo or print an array in PHP?](https://stackoverflow.com/questions/9816889/how-to-echo-or-print-an-array-in-php) – N69S Jun 01 '20 at 12:49

1 Answers1

1

Read about multidimensional array in the doc. Here is a hint :

foreach ($array as $key => $value) {
    echo $value['id'].'<br/>';
}
Musa
  • 1,334
  • 1
  • 11
  • 21