¿Ü±¹ ¼Ò½º ÀÔ´Ï´Ù.
À±´Þ À±³â È®½ÇÈ÷ Ç¥±âÇϸç, Á¤È®ÇÕ´Ï´Ù. mktime,date µî Áö½Ä¸¸ ÀÖ´Ù¸é °øºÎ ÇÏ½Ã¸é µË´Ï´ç^^
¼Ò½º Áß°£ Áß°£ÀÌ hard ¿É¼ÇÀ¸·Î Àß·Á ¾Æ·¡ÂÊÀ¸·Î µÈ°ÍÀÌ ÀÖ½À´Ï´Ù.
1ÁÙ·Î »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.
php¼Ò½ºÄÚµå & lib ¿¡ ¿Ã¸®°Ú½À´Ï´Ù.
<?
// below is the code snippet for the calendar() function which is located and
called from mainfile.php
function Calendar() {
// list of names for days and months
$days = array("ÀÏ", "¿ù", "È", "¼ö", "¸ñ", "±Ý", "Åä");
$months = array
("", "January", "February", "March", "April", "May", "June", "July", "August", "Sep
tember", "October", "November", "December");
// number of days in each month
$totalDays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
// set up some variables to identify the month, date and year to display
if(!$currYear) { $currYear = date("Y"); }
if(!$currMonth) { $currMonth = date("n"); }
if(!$currDay) { $currDay = date("j"); }
// if leap year, modify $totaldays array appropriately
if (date("L", mktime(0,0,0,$currMonth,1,$currYear)))
{
$totalDays[2] = 29;
}
// set up variables to display previous and next months correctly
// defaults for previous month
$prevMonth = $currMonth-1;
$prevYear = $currYear;
// if January, decrement year and set month to December
if ($prevMonth < 1)
{
$prevMonth=12;
$prevYear--;
}
// defaults for next month
$nextMonth = $currMonth+1;
$nextYear = $currYear;
// if December, increment year and set month to January
if ($nextMonth > 12)
{
$nextMonth=1;
$nextYear++;
}
// get down to displaying the calendar
// find out which day the first of the month falls on
$firstDayOfMonth = date("w", mktime(0,0,0,$currMonth,1,$currYear));
$x=0;
$dateList=array();
?>
<< |
<? echo $months[$currMonth] . " " . $currYear; ?
> |
>> |
<?
for ($x=0; $x
1
Copyright ¨Ï 2000-2025 BCPARK Inc. All Right Reserved.
