$diarymth = $_POST['diarymth'];
$diaryyear = $_POST['diaryyear'];
$diarydate = "$diaryyear-$diarymth-$diaryday";
$h = mktime(0, 0, 0, $diarymth, $diaryday, $diaryyear);
$d = date("F dS, Y", $h) ;
// CHECKS WHAT DAY OF WEEK DIARY SELECTION IS
$w= date("l", $h) ;
$w is meant to capture the date selected and show the day of week.
However, if I select April 31st, 2012 (which doesn't exist!), it shows it as a Tuesday.
How is this possible?? Is PHP not working right?