for ($daynumber=0; $daynumber < $numberofdays ; $daynumber++)
{
$newdate = mktime (0,0,0,date("m") ,date("d")+$daynumber,date("Y"));
echo "<td width=65><center>".date("D",$newdate)."<br>".date("d M",$newdate)."</td>\n";
}
Not sure if this helps but above is some code I wrote which cycles through from the current day to a date $numberofdays days in the future - it puts them into a table, but you can do with them what you want. Just change the $numberofdays to 365 (you can even do it in the link ie "calendar.php?numberofdays=365") and it will display that many days in thefuture.
This also gets around the fact that you're not sure whether its a leap year or not...