I have this script which displays the start date an end date for each week in a month.
I would like to somehow filter out the first week that may start with Saturday.. For example if we take August 2015 as an example, the first week
<?php
$textdt="01 Aug 2015";
$dt= strtotime( $textdt);
$currdt=$dt;
$nextmonth=strtotime($textdt."+1 month");
$i=0;
do
{
$weekday= date("w",$currdt);
$nextday=7-$weekday;
$endday=abs($weekday-7);
$startarr[$i]=$currdt;
$endarr[$i]=strtotime(date("Y-m-d",$currdt)."+$endday day");
$currdt=strtotime(date("Y-m-d",$endarr[$i])."+1 day");
echo "Week ".($i+1)." - ". date("d-m-Y",$startarr[$i])." to ". date("d-m-Y",$endarr[$i])."<br>";
$i++;
}while($endarr[$i-1]<$nextmonth);
?>
Current output
Week 1 - 01-08-2015 to 02-08-2015
Week 2 - 03-08-2015 to 09-08-2015
Week 3 - 10-08-2015 to 16-08-2015
Week 4 - 17-08-2015 to 23-08-2015
Week 5 - 24-08-2015 to 30-08-2015
Week 6 - 31-08-2015 to 06-09-2015
Desired output
Week 1 - 03-08-2015 to 09-08-2015
Week 2 - 10-08-2015 to 16-08-2015
Week 3 - 17-08-2015 to 23-08-2015
Week 4 - 24-08-2015 to 30-08-2015
Week 5 - 31-08-2015 to 06-09-2015