0) { $workingDays += $no_remaining_days; } foreach ($holidays as $holiday) { $time_stamp = strtotime($holiday); if ($startDate <= $time_stamp && $time_stamp <= $endDate && date("N", $time_stamp) != 6 && date("N", $time_stamp) != 7) $workingDays--; } return $workingDays; } if (isset($_POST["submit"])) { // $date1 = date_create("2023-07-1"); // $date2 = date_create("2023-07-31"); $date1 = date_create($_POST["date1"]); $date2 = date_create($_POST["date2"]); $startDate = date_format($date1, "Y/m/d"); $endDate = date_format($date2, "Y/m/d"); $holidays = ""; $days = getWorkingDays($startDate, $endDate, $holidays); } ?>