This is the function I\'m trying to write:
function getWednesdays($month, $year) {
// Returns an array of DateTimes representing all Wednesdays this month
If DateTime is not given, you need to know the day for one date - start of unix era for example (1st Jan 1970).
Going from there, you simply locate the first wednesday, and from there find your month. Keep in mind the leap years, and you're good.
Obviously, it isn't the most efficient algorithm in the world, but it would do the job.