ai-photos.org 한글달력 (source code) by 토마스 정

$year 년 $month 월"; echo ""; echo ""; foreach ($daysOfWeek as $day) { echo ""; } echo ""; if ($startDayOfWeek > 0) { echo str_repeat("", $startDayOfWeek); } for ($day = 1; $day <= $daysInMonth; $day++) { $dayOfWeek = ($startDayOfWeek + $day - 1) % 7; $class = $dayOfWeek == 0 ? "sunday" : ""; echo ""; if (($day + $startDayOfWeek) % 7 == 0) { echo ""; } } $endDayOfWeek = ($startDayOfWeek + $daysInMonth) % 7; if ($endDayOfWeek != 0) { echo str_repeat("", 7 - $endDayOfWeek); } echo ""; echo "
$day
$day
"; } $year = isset($_GET['year']) ? intval($_GET['year']) : date('Y'); if ($year < 1999 || $year > 2099) { $year = date('Y'); } $month = isset($_GET['month']) ? intval($_GET['month']) : date('n'); generateCalendar($year, $month); ?>