Below is my code
function getWorkingDays($startDate, $endDate){
$begin=strtotime($startDate);
$end=strtotime($endDate);
if($begin>$end){
echo "startdate is in the future! <br />";
return 0;
}else{
$no_days=0;
$weekends=0;
while($begin<=$end){
$no_days++;
$what_day=date("N",$begin);
if($what_day>5) {
$weekends++;
};
$begin+=86400;
};
$working_days=$no_days-$weekends;
return $working_days;
}
}
$beginday=date("2016-04-01");
$lastday=date("2016-06-30");
$nr_work_days = getWorkingDays($beginday,$lastday);
echo $nr_work_days;
?>
above code is giving count for excluding saturday and sunday, and working fine.
then
i need one help.
how i need to pass array like public holidays list,
then exclude the public holiday then return the count of working days.