<?php
//$start_date= "AUG 01 2014"
//$end_date="AUG 31 2014"
//$weekday= saturday on weekday is always small letter
class calculateday {
	public function daysBetween($start_date, $end_date, $weekDay) {
		$first_date = strtotime ( $start_date . " -1 days" );
		$first_date = strtotime ( date ( "M d Y", $first_date ) . " next " . $weekDay );
		
		$last_date = strtotime ( $end_date . " +1 days" );
		$last_date = strtotime ( date ( "M d Y", $last_date ) . " last " . $weekDay );
		
		return floor ( ($last_date - $first_date) / (7 * 86400) ) + 1;
	}

}
?>
