这是我在 php $hotels中的数组
Array
(
[0] => Array
(
[hotel_name] => Name
[info] => info
[rooms] => Array
(
[0] => Array
(
[room_name] => name
[beds] => 2
[boards] => Array
(
[board_id] => 1
[price] =>200.00
)
)
)
)
)
如何获得board_id和price我尝试了几个 foreach 循环但无法获得结果
foreach($hotels as $row)
{
foreach($row as $k)
{
foreach($k as $l)
{
echo $l['board_id'];
echo $l['price'];
}
}
}
这段代码不起作用。