
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>";
}
?>