I am trying to print out the next 3 days from today. This code works fine but I need the dates to be in this format "2018 Sept, 29". Changing format keeps giving me errors.
<?php
// Set timezone
date_default_timezone_set('AFRICA/LAGOS');
// Start date
$date = date('Y-m-d');
// End date
$end_date = date('Y-m-d', strtotime("+3 days"));
while (strtotime($date) <= strtotime($end_date)) {
$date=DateTime::createFromFormat('Y-m-d', $date)->modify('+1 day')->format('Y-m-d');
echo $date.', ';
}
echo "<br><br>";
?>