$day_number = cal_to_jd(CAL_GREGORIAN,5,4,2013);
$week_day = jddayofweek($day_number,0);
echo $week_day;
The output will be 6. jddayofweek(Julian_day_numnber, mode )
As we have used default format so the function will return 0 for Sunday , 1 for Monday ... $week_day = jddayofweek($day_number,1);
The output will be Saturday
$week_day = jddayofweek($day_number,2);
The output will be Sat
Use jddayofweek() to return the name of the day:
$jd = gregoriantojd(9, 18, 2024);
echo jddayofweek($jd, 1); // Outputs: Wednesday
$jd = 2459583;
echo jddayofweek($jd, 0); // Outputs: 1