This is the function I\'m trying to write:
function getWednesdays($month, $year) { // Returns an array of DateTimes representing all Wednesdays this month
But I highly recommend getting used to PHP 5.3's date and time functions if you can use them. (See Gordon's answer.)