note 50632 deleted from function.icap-create-calendar by didou
| From: | didou@php.net | Date: | Sat, 17 Feb 2007 20:10:08 +0000 |
| Subject: | note 50632 deleted from function.icap-create-calendar by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123519@lists.php.net to get a copy of this message | ||
Note Submitter: nrkkalyan at rediffmail dot com
----
Simply copy this and save as cal.php. you will get a calender for the corresponding month you
select.
<?PHP
$first_date = mktime(12,0,0,2,23,2005);
$second_date = mktime(12,0,0,2,27,2005);
$offset = $second_date-$first_date;
$noofdays= floor($offset/60/60/24);
if($noofdays==0){
$hours=8;
}
else{
$hours=$noofdays * 8;
}
echo $hours ."<br>". $noofdays;
$month=date("m");
$year=date("Y");
$num = cal_days_in_month(CAL_GREGORIAN,$month,$year ); // 31
echo "<br>There was $num days in $month $year";
echo "<br>";
echo" <table>";
for ($i=1;$i<=$num; )
{
echo"<tr>";
for($j=0;$j<7 & $i<=$num;$j++)
{
echo" <td>";
echo $i . " ";
$i++;
echo" </td>";
}
echo"</tr>";
}
echo" </table>";
?>