function HolidayList($StartYear, $LastYear) { if (empty($StartYear)) { $StartYear = date("Y"); } if (empty($LastYear)) { $LastYear = date("Y"); } $FirstDate = strtotime(strval($StartYear) . "/1/1"); $LastDate = strtotime(strval($LastYear + 1) . "/1/1"); //var_dump($FirstDate, $LastDate); $OneDay = 24 * 60 * 60; $HolidayCount = 0; $HolidayData = array(); $workDate = $FirstDate; $strDate = ""; $HolidayName = ""; while ($workDate < $LastDate) { //var_dump($workDate); $strDate = date("Y/n/j", $workDate); $HolidayName = ktHolidayName($strDate); if ($HolidayName != "") { $HolidayCount++; $HolidayData[] = array('name' => $HolidayName, 'date' => $strDate); } $workDate += $OneDay; } return $HolidayData; }
*/ /*==================== DEFINE ====================*/ /*==================== BEFORE ACTIONS ====================*/ require_once "./HolidayCheck.php"; /*==================== MAIN ACTIONS ====================*/ if (isset($_GET['date']) && !empty($_GET['date'])) { $strDate = strval($_GET['date']); } elseif (isset($_POST['date']) && !empty($_POST['date'])) { $strDate = strval($_POST['date']); } else { exit; } $HolidayName = ktHolidayName($strDate); if ($HolidayName != "") { echo $HolidayName; } else { echo ""; } exit; /*==================== AFTER ACTIONS ====================*/ /*==================== FUNCTIONS ====================*/