Forum Moderators: coopster
$yr = 2008;
for($mon = 1; $mon < 13; $mon++) {
$first = strtotime("$yr-$mon-01");
$off = date('w',$first); // Get the day of the week as a number 0-6
// If it's 0 (Sunday) make the offset 1. If it's 6 (Saturday) make the offset 2. Otherwise, offset is zero.
$off = $off ? (($off == 6) ? 2 : 0) : 1;
$off += 7; // Add a week
$work6 = strtotime("+$off days",$first); // Offset the 1st of the month
echo "<div>" . date("D, j M Y",$work6) . "</div>\n";
}