I have an array of 4 email addresses. Every Tuesday I need to send out an email, so I use CRON to run a php script. The script contains an array of email addresses. Week 1 I send an email to array[0], week 2 I send an email to array[1], week 3 I send an email to array[2] and week 4 I send an email to array[3]. Then I repeat, so week 5 I send an email to array[0], and so on into infinity.
How do I do the math on date() to figure out which email to send when the script runs? The only thing I can think to do is to fill out a date lookup array for the next 10 years after a start date, then do a lookup but that seems inefficient.
Bonus points if next year, I could add another user to the array without upsetting the order to date.