function getWorkingDays($startDate, $endDate){
$begin=strtotime($startDate);
$end=strtotime($endDate);
if($begin>$end){
echo "tartdate is in the future!
";
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>6) { // 6 and 7 are weekend days
$weekends++;
};
$begin+=86400; // +1 day
};
$working_days=$no_days-$weekends;
return $working_days;
}
}
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Friday, 11 July 2014
How to calculate no of working days in php?
Subscribe to:
Post Comments (Atom)
Feet/Inches to Meters Converter & Lbs to Kgs Converter
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Feet/Inches ⇄...
-
<?php $to = "somebody@example.com, somebodyelse@example.com"; $subject = "HTML email"; $message = " <h...
-
document.onkeydown = myKeyDownHandler; function myKeyDownHandler(event){ alert(event.keyCode) }
-
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Feet/Inches ⇄...
No comments:
Post a Comment