I've got the need to have an array of the dates Mon-Fri from a specific ISO week. I can't seem to find an inbuilt method that returns an array. I am using the DateTime class with the setISODate method as follows:
$bookingDate = new DateTime();
$bookingWeek = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"));
$bookingDates = array();
$mon = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"), 1);
array_push($bookingDates, $mon);
$tue = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"), 2);
array_push($bookingDates, $tue);
$wed = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"), 3);
array_push($bookingDates, $wed);
$thu = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"), 4);
array_push($bookingDates, $thu);
$fri = $bookingDate->setISODate($bookingDate->format("Y"), $bookingDate->format("W"), 5);
array_push($bookingDates, $fri);
print_r($bookingDates);
However - the print_r of the array of dates returns each day as being Friday! Is there a way of achieving what I want?