0
날씨가 화씨에서 섭씨로 바뀌는 데 약간의 어려움이 있습니다.Google 날씨 API가 F에서 C로 변경됩니다.
현재 날씨를 바꿀 때만 작동하지만 Im을 바꿀 때가 아닙니다.
모든 요망?
이것은 내 코드입니다.
<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 ?>
toCelsius($current[0]->temp_f['data']
가 구글 날씨 API는 2012 년에 종료되었습니다 ** ** - > http://stackoverflow.com/questions/12145820/google-weather-api-gone/35943521 –