<?php
$beginday=date('Y-m-01');
$lastday=date('Y-m-t');
$nr_work_days = getWorkingDays($beginday,$lastday);
echo $nr_work_days;
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++; // no of days in the given interval
$what_day=date(“N”,$begin);
if($what_day>5) { // 6 and 7 are weekend days
$weekends++;
};
$begin+=86400; // +1 day
};
$working_days=$no_days-$weekends;
return $working_days;
}
}
Fatal error: Uncaught Error: Undefined constant "“N”" in /in/7l1vC:20
Stack trace:
#0 /in/7l1vC(6): getWorkingDays('2014-10-01', '2014-10-31')
#1 {main}
thrown in /in/7l1vC on line 20
Process exited with code 255.
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
Warning: Use of undefined constant “N” - assumed '“N”' (this will throw an Error in a future version of PHP) in /in/7l1vC on line 20
31
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
Notice: Use of undefined constant “N” - assumed '“N”' in /in/7l1vC on line 20
31