OK I figured them out:
// you must pass both $month and $year as numbers
function firstdayofmonth($month, $year)
{
$ts = mktime(0, 0, 0, $month, 1, $year);
$dt = getdate($ts);
return $dt;
}
function lastdayofmonth($month, $year)
{
// args:
// $month: month of the year as number
// $year: year as a number
// returns:
// first day of the month as day of week (ie. Saturday)
$ts = mktime(0, 0, 0, $month + 1, 0, $year);
$dt = getdate($ts);
return($dt);
}