![](/gg/hf11.gif)
"2023-02-27","high_temp" => "12°C","low_temp" => "3°C","weather_condition" => "多云","wind_speed" =>"3级"),array("date" => "2023-02-28","high_temp" => "15°C","low_temp" => "7°C","weather_condition" => "晴","wind_speed" => "2级"),array("date" => "2023-03-01","high_temp" => "18°C","low_temp" => "10°C","weather_condition" => "多云","wind_speed" => "3级"),array("date" => "2023-03-02","high_temp" => "20°C","low_temp" => "12°C","weather_condition" => "晴","wind_speed" => "2级"),array("date" => "2023-03-03","high_temp" => "17°C","low_temp" => "9°C","weather_condition" => "阴","wind_speed" => "3级"),array("date" => "2023-03-04","high_temp" => "15°C","low_temp" => "7°C","weather_condition" => "多云","wind_speed" => "2级"),array("date" => "2023-03-05","high_temp" => "12°C","low_temp" => "3°C","weather_condition" => "晴","wind_speed" => "3级"));// 获取当前日期$today = date("Y-m-d");// 循环遍历天气数据并输出foreach ($weather as $day) {// 标记今天$today_class = "";if ($day["date"] == $today) {$today_class = "today";}// 输出表格行echo "";echo "";echo "";echo "";echo "";echo "";echo "";}?>
日期
|
最高气温
|
最低气温
|
天气状况
|
风力
|
{$day["date"]}
|
{$day["high_temp"]}
|
{$day["low_temp"]}
|
{$day["weather_condition"]}
|
{$day["wind_speed"]}
|