3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* Generates a range of dates */ function dateRange( $first, $last, $step = '+1 day', $format = 'l jS F Y' ) { $dates = array(); $current = strtotime( $first ); $last = strtotime( $last ); while( $current <= $last ) { $dates[] = date( $format, $current ); $current = strtotime( $step, $current ); } return $dates; } $Event_Date = '2015-08-09'; $Event_End_Date = '2015-08-19'; $availability_range = array(); $date_start = date('l jS F Y',strtotime($Event_Date)); $date_end = date('l jS F Y',strtotime($Event_End_Date)); $range = dateRange( $date_start, $date_end ); foreach ($range as $key => $date) { array_push($availability_range, $date); } print_r( $availability_range); foreach ($availability_range as $key => $date) { echo $date . ' ----'; }
based on h29Io
Output for 5.4.0 - 7.2.0
Array ( [0] => Sunday 9th August 2015 [1] => Monday 10th August 2015 [2] => Tuesday 11th August 2015 [3] => Wednesday 12th August 2015 [4] => Thursday 13th August 2015 [5] => Friday 14th August 2015 [6] => Saturday 15th August 2015 [7] => Sunday 16th August 2015 [8] => Monday 17th August 2015 [9] => Tuesday 18th August 2015 [10] => Wednesday 19th August 2015 ) Sunday 9th August 2015 ----Monday 10th August 2015 ----Tuesday 11th August 2015 ----Wednesday 12th August 2015 ----Thursday 13th August 2015 ----Friday 14th August 2015 ----Saturday 15th August 2015 ----Sunday 16th August 2015 ----Monday 17th August 2015 ----Tuesday 18th August 2015 ----Wednesday 19th August 2015 ----