Returns a full textual representation of the day of the week for the first day of the month for a valid month/year combination.
function FirstDayOfMonth($month, $year) {
if (empty($month)) {
$month = date('m');
}
if (empty($year)) {
$year = date('Y');
}
$result = strtotime("{$year}-{$month}-01");
return date('l', $result);
}