note 50632 added to function.icap-create-calendar
| From: | nrkkalyan at rediffmail dot com | Date: | Sat, 05 Mar 2005 08:36:42 +0000 |
| Subject: | note 50632 added to function.icap-create-calendar | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85961@lists.php.net to get a copy of this message | ||
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>";
?>
----
Manual Page -- http://www.php.net/manual/en/function.icap-create-calendar.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50632
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50632&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50632&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50632&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50632&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50632&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50632&report=yes
Search -- http://master.php.net/manage/user-notes.php