I think you are looking for some thing like this
function getDatesFromRange($start, $end, $format = 'l - d F - Y') {
// Declare an empty array
$array = array();
// Variable that store the date interval
// of period 1 day
$interval = new DateInterval('P1D');
$realEnd = new DateTime($end);
$realEnd->add($interval);
$period = new DatePeriod(new DateTime($start), $interval, $realEnd);
// Use loop to store date into array
foreach($period as $date) {
$array[] = $date->format($format);
}
// Return the array elements
return $array;
}
// Function call with passing the start date and end date
$dates = getDatesFromRange('2010-10-01', '2010-10-05');
echo '<pre>';
print_r($dates);
Output :
Array
(
[0] => Friday - 01 October - 2010
[1] => Saturday - 02 October - 2010
[2] => Sunday - 03 October - 2010
[3] => Monday - 04 October - 2010
[4] => Tuesday - 05 October - 2010
)