´äº¯ °¨»çÇÕ´Ï´Ù...
Ãß°¡ ºÎºÐÀº
¾Æ·¡ºÎºÐÀÇ ############ºÎºÐÀ» Ãß°¡ ÇÏ¿´À¾´Ï´Ù. ##############
ÀÌÄÉÇϴϱñ µË´Ï´Ù..^^
¹°·Ð Á¶±Ý ¼öÁ¤À» ÇßÁö¸¸¿ä....
°í¸¿½À´Ï´Ù...^^
¿À´Ãµµ Áñ°Ì°Ô º¸³»¼¼¿ä...^0^
########## Çش翬¿ùÀÇ Àϼö¸¦ °è»êÇÑ´Ù.
function get_totaldays($year,$month)
{
$date = 1;
while(checkdate($month,$date,$year))
{
$date++;
}
$date--;
return $date;
}
########## Çش翬¿ùÀÇ ´Þ·ÂÀ» Ãâ·ÂÇÑ´Ù.
function showCalendar($year,$month,$total_days,$today)
{
$first_day = date('w', mktime(0,0,0,$month,$today,$year));
echo("
${year}³â ${month}¿ù ´Þ·Â
ÀÏ | ¿ù | È | ¼ö | ¸ñ | ±Ý | Åä | ");
$col = 0; for($i = 0; $i < $first_day; $i++) { echo(" | "); $col++; }
for($j = $today; $j <= $total_days; $j++) { echo(" ${month}¿ù ${j}ÀÏ | "); $col++;
if($col == 7) { echo(" "); if($j != $total_days) { echo(""); } $col = 0; } } ###############################Ãß°¡½ÃÀÛ $month++; if($month=="13") { $month="1"; } for($n = 1; $n< $today; $n++) { echo(" ${month}¿ù ${n}ÀÏ | "); $col++;
if($col == 7) { echo(" "); if($n != $today) { echo(""); } $col = 0; } }
#############################Ãß°¡³¡
while($col > 0 && $col < 7) { echo(" | "); $col++; } } echo("
|
");
?>
PHP·Î ±¸ÇöÇÏ´Â ´Þ·ÂÇÁ·Î±×·¥
$inputY = date('Y'); // ¿À´ÃÀÇ ³âµµ
$inputM = date('m'); // ¿À´ÃÀÇ ´Þ
$today = date('d'); // ¿À´ÃÀÇ ÀÏ
$inputM =$inputM*1;
$totaldays = get_totaldays($inputY,$inputM);
showCalendar($inputY,$inputM,$totaldays,$today);
?>