Errica
07-11-2007, 03:09 AM
I'm attempting to display information for today, the next day and the day after (so only three days worth).
The first day is hardcoded to say now. I want the next day and the day after to be the abbreviated day (ie. Tue, Wed and so on).
The problem I have with the following code is that now and the next day are the same. Thus, I have now (which is Tue), the next day (which is ALSO Tues - wrong!) and the day after is Wed (you guessed it...wrong!). :)
Someone please help me fix this :(
Here's the include:
$return['mydata'] = array();
for($i = 0; $i < 2; $i++) {
$attr = explode('"', $this->tag('blm:mydata',$i));
if(count($attr) > 1) {
$day = array();
$day['when'] = $attr[1];
$day['image'] = IMAGES.$this->translate($attr[11]).'.gif';
array_push($return['mydata'], $day);
}
}
return $return;
And here's the front-end page:
echo "\t\t\t".$stuff['mydata'][0]['when']."<br/>\n";
echo "\t\t\t".$stuff['mydata'][1]['when']."<br/>\n";
The first day is hardcoded to say now. I want the next day and the day after to be the abbreviated day (ie. Tue, Wed and so on).
The problem I have with the following code is that now and the next day are the same. Thus, I have now (which is Tue), the next day (which is ALSO Tues - wrong!) and the day after is Wed (you guessed it...wrong!). :)
Someone please help me fix this :(
Here's the include:
$return['mydata'] = array();
for($i = 0; $i < 2; $i++) {
$attr = explode('"', $this->tag('blm:mydata',$i));
if(count($attr) > 1) {
$day = array();
$day['when'] = $attr[1];
$day['image'] = IMAGES.$this->translate($attr[11]).'.gif';
array_push($return['mydata'], $day);
}
}
return $return;
And here's the front-end page:
echo "\t\t\t".$stuff['mydata'][0]['when']."<br/>\n";
echo "\t\t\t".$stuff['mydata'][1]['when']."<br/>\n";