next day of the week logic problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm stuck on what seems like should be a relatively easy problem.

I'm creating a simple scheduler. From a form consisting of seven checkboxes
(one for each day of the week) the user selects the days s/he would like an
event to occur at the same time each day. The selections are stored in the
database as a serialized array and periodically checked via cron to
calculate how much time until the next event is to occur. For example let's
say the user selects Monday, Wednesday & Saturday @ 1:00pm. So if the
current day/time is Sunday @ 3:15pm, the next event will occur in 21:45.

I know strtotime() will calculate the length of time, but my dilemma is how
to determine the next day in the revolving sequence of days from the user's

All suggestions appreciated.

Re: next day of the week logic problem

Quoted text here. Click to load it

like this?
mktime (0, 0, 0, date("m")  , date("d")+1, date("Y"));

Site Timeline