note 12361 deleted from function.mktime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 20:33:13 +0000 |
| Subject: | note 12361 deleted from function.mktime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56247@lists.php.net to get a copy of this message | ||
Note Submitter: jaeger@skywebs.net
----
To list all days of the year $year:
<?
$year=2001;
for ($month=1;$month<=12;$month++)
{
$day=1;
$thismonth=$month;
while($month==$thismonth)
{
$thismonth=date("m",mktime(23,59,59,$month,$day,$year));
$maxdays=date("d",mktime(23,59,59,$month,$day-1,$year));
$day++;
}
$fullmonth=date("F",mktime(0,0,0,$month,1,2000));
echo "$fullmonth has $maxdays days:<br>\n";
echo "<table>\n";
for ($day=1;$day<=$maxdays;$day++)
{
if($day==1 || $day==11 || $day==21 || $day== 31)
{ echo "<tr>"; }
echo "<td>$day.$month.</td>";
if($day==10 || $day==20 || $day==30 || $day==$maxdays)
{ echo "</tr>\n"; }
}
echo "</table><br>";
}
?>