I need to write some code in PHP that performs an action only on alternating weeks, based on the day of the week (mon, tue etc) rather than the number (1st, 7th etc).
So on a cycle starting on a Monday it should run for one week then not the following week.
I am sure this must be easier than I think but can’t seem to work it out, so help please!
You could simply take the week number, and perform your action when it is odd (or even!), if the day is monday, for example: