I need help Select every other Wednesday starting on 5/2/12. This code below selects every other Wednesday starting on the week it currently is. But i need to set the beginning
Use mktime to create your starting date and pass that as the second argument to strtotime so that counting starts from there:
$startDate = mktime(0, 0, 0, 5, 2, 2012); // May 2, 2012
for ($i = 0; $i < $number_of_dates; $i++) {
$date = strtotime('Wednesday +' . ($i * 2) . ' weeks', $startDate);
echo date('m-d-Y', $date). "
".PHP_EOL;
}
See it in action.