[Solved] Get n occurrences of a weekday


Take a look into this.

You can do something like:

strtotime("+1 week", timestamp);

Where timestamp is the UNIX timestamp for the start date. You can replace 1 with a variable, and by using a loop you can write a generic function.

Hope this helps.

Edit #1:

Also, you can recur to strtotime() to generate your timestamp:

strtotime("+1 week", strtotime('2014-05-30'));

A possible whole solution would be (untested code):

for ($i = 1; $i <= 4; $i ++) {
   strtotime("+" . $i . " week", strtotime('2014-04-25'));
}

4

solved Get n occurrences of a weekday