Giriş

Orijinalini görmek için tıklayınız : Php hava durumu


Vesaire
31 Ağustos 2016, 13:49
$sehir = "istanbul";
$url = '[Only Registered Users Can See Links]' . $sehir . '&format=json&num_of_days=1&lang=tr&key=756aa1f74eddc62a5e2e23cc63175';
$content = file_get_contents($url);
$json = json_decode($content, true);

echo '<div id="weather" class="block-inner mini-width">';
echo '<img alt="weather" src="' . $json["data"]["current_condition"][0]["weatherIconUrl"][0]["value"] . '" />';
echo '<p>' . $sehir . ' Hava Durumu</p>';
echo '<p><span class="derece">' . $json["data"]["current_condition"][0]["temp_C"] . '° C</span></p>';
echo '<p class="big"><strong>Nem : </strong>%' . $json["data"]["current_condition"][0]["humidity"] . '</p>';
echo '</div>';