<?php
$sehir=@file_get_contents("http://www.nkfu.com/turkiye-81-il-listesi/");
preg_match_all('@<td width="143">(.*?)</td>@si',$sehir,$sehirler);
function getir($key){
if(isset($_POST[$key]))
return $_POST[$key];
}
if(count($_POST)>0){
$sehirim=getir("sehirr");
$degisecek=["ğ","ı","ş","I","ö","Ç","ç","ü","Ş"];
$yeni=["g","i","s","i","o","C","c","u","S"];
$sehirim=str_replace($degisecek,$yeni,$sehirim);
$veri=@file_get_contents("http://www.mynet.com/havadurumu/asya/turkiye/".$sehirim."");
preg_match_all('@<span class="hvDeg1">(.*?)</span>@si',$veri,$enYuksek);
preg_match_all('@<span class="hvDeg2">(.*?)</span>@si',$veri,$enDusuk);
preg_match_all('@<span class="hvMood">(.*?)</span>@si',$veri,$hvMood);
preg_match_all('@<span class="hvDay">(.*?)</span>@si',$veri,$hvGun); }
?>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form method="POST" >
<select name="sehirr" >
<?php for($i=0;$i<=81;$i++) echo "<option value='".$sehirler[0][$i] = strip_tags($sehirler[0][$i])."'>".$sehirler[0][$i]."</option>";?>
</select>
<input type="submit" value="Göster"></br></br>
</form>
<table border="4" style="margin-left:200px">
<tr><td colspan="6" style="text-align:center"><?php $s=strtoupper($sehirim); echo $s;?> 5 GÜNLÜK HAVA DURUMU</td>
<tr>
<td>GÜNLER</td>
<td><?php echo @$hvGun[0][0]?></td>
<td><?php echo @$hvGun[0][1]?></td>
<td><?php echo @$hvGun[0][2]?></td>
<td><?php echo @$hvGun[0][3]?></td>
<td><?php echo @$hvGun[0][4]?></td>
</tr>
<tr>
<td>DURUM</td>
<td><?php
$durum=strip_tags(str_replace($degisecek,$yeni,$hvMood[0][0]));
if($durum=="Yagisli") echo "<img src='rain.png'/>";
else if($durum=="Parcali Bulutlu") echo "<img src='parcali.png'/>";
else if ($durum=="Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Hafif Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Cok Bulutlu") echo "<img src='bulutlu.png'/>";
else if ($durum=="Gunesli") echo "<img src='gunesli.png'/>";
?></br>
<?php echo @$hvMood[0][0] ?>
</td>
<td><?php
$durum=strip_tags(str_replace($degisecek,$yeni,$hvMood[0][1]));
if($durum=="Yagisli") echo "<img src='rain.png'/>";
else if($durum=="Parcali Bulutlu") echo "<img src='parcali.png'/>";
else if ($durum=="Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Hafif Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Cok Bulutlu") echo "<img src='bulutlu.png'/>";
else if ($durum=="Gunesli") echo "<img src='gunesli.png'/>";
?></br><?php echo @$hvMood[0][1]?></td>
<td><?php
$durum=strip_tags(str_replace($degisecek,$yeni,$hvMood[0][2]));
if($durum=="Yagisli") echo "<img src='rain.png'/>";
else if($durum=="Parcali Bulutlu") echo "<img src='parcali.png'/>";
else if ($durum=="Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Hafif Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Cok Bulutlu") echo "<img src='bulutlu.png'/>";
else if ($durum=="Gunesli") echo "<img src='gunesli.png'/>";
?></br><?php echo @$hvMood[0][2]?></td>
<td><?php
$durum=strip_tags(str_replace($degisecek,$yeni,$hvMood[0][3]));
if($durum=="Yagisli") echo "<img src='rain.png'/>";
else if($durum=="Parcali Bulutlu") echo "<img src='parcali.png'/>";
else if ($durum=="Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Hafif Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Cok Bulutlu") echo "<img src='bulutlu.png'/>";
else if ($durum=="Gunesli") echo "<img src='gunesli.png'/>";
?></br><?php echo @$hvMood[0][3]?></td>
<td><?php
$durum=strip_tags(str_replace($degisecek,$yeni,$hvMood[0][4]));
if($durum=="Yagisli") echo "<img src='rain.png'/>";
else if($durum=="Parcali Bulutlu") echo "<img src='parcali.png'/>";
else if ($durum=="Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Hafif Kar Yagisli") echo "<img src='kar.png'/>";
else if ($durum=="Cok Bulutlu") echo "<img src='bulutlu.png'/>";
else if ($durum=="Gunesli") echo "<img src='gunesli.png'/>";
?></br><?php echo @$hvMood[0][4]?></td>
</tr>
<tr>
<td>EN YÜKSEK SICAKLIK</td>
<td><?php echo @$enYuksek[0][0]?></td>
<td><?php echo @$enYuksek[0][1]?></td>
<td><?php echo @$enYuksek[0][2]?></td>
<td><?php echo @$enYuksek[0][3]?></td>
<td><?php echo @$enYuksek[0][4]?></td>
</tr>
<tr>
<td>EN DÜŞÜK SICAKLIK
<td><?php echo @$enDusuk[0][0]?></td>
<td><?php echo @$enDusuk[0][1]?></td>
<td><?php echo @$enDusuk[0][2]?></td>
<td><?php echo @$enDusuk[0][3]?></td>
<td><?php echo @$enDusuk[0][4]?></td>
</tr>
</table>
</body>
</html>