자유롭게 게시물을 올릴수있는 게시판입니다.
  • 유년추억
  • 학교생활
  • 입시준비
  • 대학생활
  • 군생활
  • 알바생활
  • 취업준비
  • 직장생활
  • 원룸생활
  • 연애중
  • 결혼준비
  • 집안살림
  • 자녀교육
  • 창업준비
  • 이민유학
  • 노후생활
  • 전체보기


달력 만드는 소스 입니다

 
외국 소스 입니다.
윤달 윤년 확실히 표기하며, 정확합니다. 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();

?>












<?
for ($x=0; $x

2003-02-05 18:46:50
899 번 읽음
☞ 로그인 후 의견을 남기실 수 있습니다
 캐시선물





365ch.com 128bit Valid HTML 4.01 Transitional and Valid CSS!
태그
<< <? echo $months[$currMonth] . " " . $currYear; ?
>
>>