Category Covered

Get all dates of the current month in PHP

Use the following code to get all the dates on the current month

 

$todate = date('d');
for($i = $todate; $i<=31; $i++){
$allDates[] = date('Y-m').'-'.$i;
$dt = strtotime(date('m/'.$i.'/Y'));
$day = date("l", $dt).'-';
}
print_r($allDates)