what i need it to do is count FROM the start date TO the end date of the numbers, aka count out the dates in the given week.
any help is appretiated!
Code: Select all
function findWeekPeriod($week, $year)
{
$aPeriod = array();
$startDay = 'Mon';
$endDay = 'Sun';
$startdate = strtotime('+' . $week . ' week',mktime(0,0,0,1,1,$year));
$enddate = $startdate;
while(date("D",$startdate) != $startDay){
$startdate = mktime(0,0,0,date("m",$startdate),date("d",$startdate)-1, date("Y",$startdate));
}
while(date("D",$enddate) != $endDay){
$enddate = mktime(0,0,0,date("m",$enddate),date("d",$enddate)+1, date("Y",$enddate));
}
return array('start' => date('l d/m/y', $startdate),
'end' => date('l d/m/y', $enddate));
}