Login   Register  
PHP Classes
elePHPant
Icontem

3 day forecast?

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP Yahoo Weather Class  >  All threads  >  3 day forecast?  >  (Un) Subscribe thread alerts  
Subject:3 day forecast?
Summary:How to get a 3 day forecast?
Messages:1
Author:Marcus
Date:2009-10-21 06:32:11
 

  1. 3 day forecast?   Reply   Report abuse  
Picture of Marcus
Marcus
2009-10-21 06:32:12
How to get a 3 day forecast?
For some reason your version 2 only shows a 2 day forecast?

<?php
for ($day=0; isset($weather_chile->forecast[$day]); $day++) {

//my attempt to stop after 3
if ($day >= 3) {
break;
}
// attempt end

echo "day: ".$weather_chile->forecast[$day]['DAY']."<br>";
echo "low C: ".$weather_chile->forecast[$day]['LOW']."<br>";
echo "high C: ".$weather_chile->forecast[$day]['HIGH']."<br>"; echo "<img src=http://us.i1.yimg.com/us.yimg.com/i/us/we/52/".$weather_chile->forecast[$day]['CODE'].".gif>";
echo "<hr>";
}
?>