Is it possible to get the name of the day in the row of numbers converted to date
?
I Have Code :
$date1 = date('Y-m-01');
$Month = date('m', strtotime($date1));
$Year = date('Y', strtotime($date1));
$Maximum_Date = date('t', strtotime($date1));
for($Date = 1; $Date <= $Maximum_Date; $Date++){
$DataDate = $Date . ' ' . $Month . ' ' . $Year . '<BR>';
echo $DataDate;
}
Result :
1 04 2019
2 04 2019
3 04 2019
etc..
What I want is to change it to display the name of the day on that date
For Example Date in April :
Monday, 1 04 2019
Tuesday, 2 04 2019
Wednesday, 3 04 2019
etc..
[UPDATE] April 15, 2019
Refer to comments, I see documentation here and apply with mktime();
So I Update The Code :
$date1 = date('Y-m-01');
$Month = date('m', strtotime($date1));
$Year = date('Y', strtotime($date1));
$Maximum_Date = date('t', strtotime($date1));
for($Date = 1; $Date <= $Maximum_Date; $Date++){
echo date("l, d m Y", mktime(0, 0, 0, $Month, $Date, $Year)) . '<br>';
}
And get the result :
Monday, 1 04 2019
Tuesday, 2 04 2019
Wednesday, 3 04 2019
etc..