【发布时间】:2011-12-24 23:37:52
【问题描述】:
我在将天气度数从华氏度更改为摄氏度时遇到了一些麻烦。
只有当我改变当前天气程度时它才能正常工作,但当我改变预测时它就不行了。
有什么建议吗?
这是我的代码。
<h2>Today's weather</h2>
<div class="weather">
<img src="<?= 'http://www.google.com' . $current[0]->icon['data']?>" alt="weather"?>
<span class="condition">
<?= $current[0]->temp_f['data'] ?>° F,
<?= $current[0]->condition['data'] ?>
</span>
</div>
<h2>Forecast</h2>
<? foreach ($forecast_list as $forecast) : ?>
<div class="weather">
<img src="<?= 'http://www.google.com' . $forecast->icon['data']?>" alt="weather"?>
<div><?= $forecast->day_of_week['data']; ?></div>
<span class="condition">
<?= $forecast->low['data'] ?>° F - <?= $forecast->high['data'] ?>° F,
<?= $forecast->condition['data'] ?>
</span>
</div>
<? endforeach ?>
【问题讨论】:
-
Google 天气 API 已于 2012 年关闭 -> stackoverflow.com/questions/12145820/google-weather-api-gone/…
标签: php api google-weather-api