<?php
error_reporting(-1);
date_default_timezone_set('UTC');
function getWednesdays($y, $m)
{
$ts = strtotime("first wednesday $y-$m-01");
$end = strtotime("last wednesday $y-$m");
$wednesdays = array();
while($ts <= $end) {
$wednesdays[] = $ts;
$ts = strtotime('next wednesday', $ts);
}
return $wednesdays;
}
foreach (getWednesdays(2010, 11) as $wednesday) {
echo date("l, Y-m-d\n", $wednesday);
}
echo 'PHP' . phpversion();