Posted By

hasantayyar on 07/11/09


Tagged

php weather hava durumu


Versions (?)

msn weather ile hava durumu


 / Published in: PHP
 

URL: http://code.internet.com.tr/msn-weather-ile-hava-durumu/

  1. <?php
  2. header("Content-Type: text/html; charset=utf-8");
  3.  
  4. include "weather.class.php";
  5. include "cache.class.php";
  6.  
  7. $weather = new Weather();
  8. $array = $weather->GetWeather($_REQUEST['id']);
  9. $array2 = $weather->GetWeather($_REQUEST['id'], true);
  10.  
  11.  
  12. echo '<div><strong>gunluk</strong></div>';
  13. echo '<div>'.$array[0][place].' - '.$array[0][day].' tarihli hava durumu</div>';
  14. echo '<div>sicaklik : '.$array[0][degree].'</div>';
  15. echo '<div>nem : '.$array[0][humidity].'</div>';
  16. echo '<div>ruzgar : '.$array[0][winds].'</div>';
  17. echo '<div>hissedilen : '.$array[0][feels].'</div>';
  18. echo '<div>aciklama : '.$array[0][desc].'</div>';
  19. echo '<div>resim : <img src="images/'.$array[0][image].'"></div>';
  20.  
  21. echo '<div><strong>5 gunluk</strong></div>';
  22.  
  23. $i = 0;
  24. foreach($array2 as $hava)
  25. {
  26.  
  27. if($i == 0)
  28. {
  29. echo '<div>'.$hava[place].' - '.$hava[day].' tarihli hava durumu</div>';
  30. echo '<div>sicaklik : '.$hava[degree].'</div>';
  31. echo '<div>nem : '.$hava[humidity].'</div>';
  32. echo '<div>ruzgar : '.$hava[winds].'</div>';
  33. echo '<div>hissedilen : '.$hava[feels].'</div>';
  34. echo '<div>aciklama : '.$hava[desc].'</div>';
  35. echo '<div>resim : <img src="images/'.$hava[image].'"></div>';
  36. } else {
  37.  
  38. $tarihayir = explode('.',$array2[0][day]);
  39. $gun = $tarihayir[0] + $i;
  40. $time = date("d.m.Y", mktime(0, 0, 0, $tarihayir[1], $gun, $tarihayir[2]));
  41.  
  42. echo '<div>'.$array2[0][place].' - '.$time.' tarihli hava durumu</div>';
  43. echo '<div>en yuksek : '.$hava[high].'</div>';
  44. echo '<div>en alcak : '.$hava[low].'</div>';
  45. echo '<div>degisim : % '.$hava[chance].'</div>';
  46. echo '<div>aciklama : '.$hava[desc].'</div>';
  47. echo '<div>resim : <img src="images/'.$hava[image].'"></div>';
  48.  
  49. }
  50.  
  51. $i = $i + 1;
  52. }
  53.  
  54. ?>

Report this snippet  

You need to login to post a comment.