1 回答
TA贡献2080条经验 获得超4个赞
您需要创建一个多维数组(数组的数组),
一旦你有了数组,你就可以迭代它。
$cars = [
[
"available" => "Available",
"name" => "Duster",
"model" =>"Nissan",
"price" => 333,
"location" => "Hollywood"
],
[
"available" => "Available",
"name" => "Schiff",
"model" =>"Öltanker",
"price" => 223123213132,
"location" => "Baltisches Meer"
],
[
"available" => "NOT Available",
"name" => "Hubschrauber",
"model" =>"Pew Pew",
"price" => 98756,
"location" => "Dschungel"
],
[
"available" => "Available",
"name" => "Panzer",
"model" =>"Bundesheer",
"price" => 98753,
"location" => "Kaserne"
],
];
foreach ($cars as $car) {
echo $car['available'];
}
- 1 回答
- 0 关注
- 121 浏览
添加回答
举报