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