I tried your code, and just echo'd like this:
echo('$setyear-$setmonth-01');
and the output was:
$setyear-$setmonth-01
So, instead of:
$dayOfWeek = date('l', strtotime('$setyear-$setmonth-01'));
Try:
$dayOfWeek = date('l', strtotime($setyear .'-'. $setmonth .'-01'));
But, I'm glad you got it working. I just like strtotime() better than mktime(). No particular reason, except that it's easier to read.
Mark