PHP function jddayofweek() returns the day of the week for a given date.
You need to first convert a Gregorian date to a Julian Day Count and then use PHP function jddayofweek() to get the day.
E.g.
<?php
$jd = gregoriantojd(10,6,2020);
echo jddayofweek($jd, 1);
echo "\n";
?>
The above code will print: Tuesday