ForumTEK.Net - IRC Forumu

ForumTEK.Net - IRC Forumu (http://www.forumtek.net/index.php)
-   PHP (http://www.forumtek.net/forumdisplay.php?f=137)
-   -   Php hava durumu (http://www.forumtek.net/showthread.php?t=4001)

Vesaire 31 Ašustos 2016 13:49

Php hava durumu
 
PHP- Kodu:

$sehir = "istanbul"; 
$url = 'http://api.worldweatheronline.com/free/v2/weather.ashx?q=' . $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>'; 



All times are GMT +3. The time now is 12:12.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.