- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$month=10;
$year=2014;
// Mantech
$startDate = strtotime($month.'/1/'.$year);
$stopDate = strtotime('last day of this month ',$startDate);
if (date('D',$startDate)!='Sat'){
$startDate = strtotime('next saturday',$startDate);
}
if (date('D',$stopDate)!='Fri'){
$stopDate = strtotime('next friday',$stopDate);
}
echo (date('Y-m-d',$startDate).' - '.date('Y-m-d',$stopDate));