Using php we can easily find difference in days excluding weekends. First take start date and end date and generate strtotime for these dates to convert into string. After manipulation using while loop we can easily get the count of week days excluding weekend i.e saturday and sunday where date('N') gets the day of the week (1 - Monday, 2-Tuesday, 3-wednesday, 4-thursday,5-friday, 6-saturday, 7 - Sunday)
$start = strtotime('2012-08-06');
$end = strtotime('2012-09-06');
$count = 0;
while(date('Y-m-d', $start) < date('Y-m-d', $end)){
$count += date('N', $start) < 6 ? 1 : 0;
$start = strtotime("+1 day", $start);
}
echo $count;
0 Comment(s)