this code is use for date with day name
$month = 12;
$year = 2019;
$dayCount = date('t', strtotime('01-' . $month . '-' . $year));
$days = [];
for ($i = 1; $i <= $dayCount; $i++) {
$tempDate = $year . '-' . $month . '-' . $i;
$days[] = sprintf('%04d-%02d-%02s', $year, $month, date('D', strtotime($tempDate)));
}
echo json_encode($days, JSON_PRETTY_PRINT);