msn weather ile hava durumu
URL: http://code.internet.com.tr/msn-weather-ile-hava-durumu/
Copy this code and paste it in your HTML
<?php
header("Content-Type: text/html; charset=utf-8");
include "weather.class.php";
include "cache.class.php";
$weather = new Weather();
$array = $weather->GetWeather($_REQUEST['id']);
$array2 = $weather->GetWeather($_REQUEST['id'], true);
echo '<div><strong>gunluk</strong></div>';
echo '<div>'.$array[0][place
].' - '.$array[0][day
].' tarihli hava durumu</div>';
echo '<div>sicaklik : '.$array[0][degree
].'</div>';
echo '<div>nem : '.$array[0][humidity
].'</div>';
echo '<div>ruzgar : '.$array[0][winds
].'</div>';
echo '<div>hissedilen : '.$array[0][feels
].'</div>';
echo '<div>aciklama : '.$array[0][desc
].'</div>';
echo '<div>resim : <img src="images/'.$array[0][image
].'"></div>';
echo '<div><strong>5 gunluk</strong></div>';
$i = 0;
foreach($array2 as $hava)
{
if($i == 0)
{
echo '<div>'.$hava[place
].' - '.$hava[day
].' tarihli hava durumu</div>';
echo '<div>sicaklik : '.$hava[degree
].'</div>';
echo '<div>nem : '.$hava[humidity
].'</div>';
echo '<div>ruzgar : '.$hava[winds
].'</div>';
echo '<div>hissedilen : '.$hava[feels
].'</div>';
echo '<div>aciklama : '.$hava[desc
].'</div>';
echo '<div>resim : <img src="images/'.$hava[image
].'"></div>';
} else {
$tarihayir = explode('.',$array2[0][day
]);
$gun = $tarihayir[0] + $i;
$time = date("d.m.Y", mktime(0, 0, 0, $tarihayir[1], $gun, $tarihayir[2]));
echo '<div>'.$array2[0][place
].' - '.$time.' tarihli hava durumu</div>';
echo '<div>en yuksek : '.$hava[high
].'</div>';
echo '<div>en alcak : '.$hava[low
].'</div>';
echo '<div>degisim : % '.$hava[chance
].'</div>';
echo '<div>aciklama : '.$hava[desc
].'</div>';
echo '<div>resim : <img src="images/'.$hava[image
].'"></div>';
}
$i = $i + 1;
}
?>
Report this snippet