value as follows: // key: the index of the repeating value; and // value: the repeating value (date) $existingHolidays = array_intersect($allDates, $holidays); // remove/delete the official holidays from the $allDates array // array_search() searches the array for a given value // Returns the corresponding key if successful foreach ($existingHolidays as $holiday => $date): $index = array_search($date, $allDates); if($index !== FALSE): unset($allDates[$index]); endif; endforeach; // check which of the remaining days are weekdays foreach ($allDates as $dateIndex => $date): if (isWeekend($date)): unset($allDates[$dateIndex]); endif; endforeach; // printing the result if (sizeof($allDates) > 0): echo "