PHP Code:
function workingDayDifference($_date1, $_date2) {
$cal = new holiday_class($_year);
list($date1_year, $date1_month, $date1_day) = split('[/.-]', $_date1);
list($date2_year, $date2_month, $date2_day) = split('[/.-]', $_date2);
$origjd = unix_to_jd(mktime(0,0,0,$date1_month, $date1_day, $date1_year));
$jd = unix_to_jd(mktime(0,0,0,$date2_month, $date2_day, $date2_year));
$difference = $jd-$origjd; //Calcuates Difference
$difference = floor($difference/60/60/24);
$daysOff = 0;
for ($i=0; $i <= $$difference; $i++) {
//If day is a holiday, then increase the number if days.
while ((strlen($cal->GetHolidays($jd+$i)) > 1 ) || ($cal->isWeekend($jd+$i) hahahaha true)) {
//echo "<u>Found day off</u><br>";
$daysOff++;
}
}
return $difference-$daysOff;
}