Hi I am building a web app that displays the weather based off of the zip code a user submits. I've got it working almost perfectly except that I've got one stupid thing I can't get to work. I need the day of the week that is pulled for the 5 day forecast to be truncated to only the first 3 characters, i.e THU, SUN, SAT. Here's the code that pulls in the day. The snipit that calls the day is $w->day_of_week thanks in advance for your help.
$zip = $_POST['yourzip'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://weather.wdtinc.com/feeds/wfld/worldForecast2Xml.php?ZIP=$zip&UNITS=us&TIMEZONE=local");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$xmlstr = curl_exec($ch);
curl_close($ch);
$forecast = new SimpleXMLElement($xmlstr);
#print_r($forecast);
$info = (isset($forecast->forecast_info) ? $forecast->forecast_info : array());
#print_r($info);
$days = (isset($forecast->daily_summary) ? $forecast->daily_summary : array());
foreach ($days as $n => $w) {
$img = wx_decode($w->wx_code);
}
echo "\n<h2 align='center'>5 Day Forecast</h2>\n\n";
foreach (array(0,1,2,3,4) as $n) {
$w = $days[$n];
$img = wx_decode($w->wx_code);
echo "<div class='days'>
<div class='dayofweek' align='center'>$w->day_of_week</div>
<div class='icon'><img src='http://www.iwitnessweather.com/wp-content/themes/whiteboard 2.0.1/images/$imgsmall' alt='$alt'></div>
<div class='temp'><span class='high'>$w->high</span>/<span class='low'>$w->low</span></div>
</div>";
}