I have 3 clubs each hold several classes on certain days i.e
- Club 1, Class Friday 6-7pm, Class Friday 7-8pm, Class Friday 8-9pm
- Club 2, Class Tuesday 7-8pm, Class Tuesday 8-9.30pm
- Club 3, Class Monday 7-8.30pm, Class Wednesday 7-8.30pm, Class Friday 7-8.30pm
and i want to run a script to return a list of classes for the coming week. but i am unsure of the best approach.
Ideally i don't want to use a database as each week the classes are held on the same night at the same time.
So what i think i want to achieve is:
- get the current day
- get the next 7 days from current day and their date
- run a check on each day of the upcoming week to see if there is a class on
- list the classes if matched
it sounds easy in principle but these things never are, for me at least.
what i have so far for the current day is
$today = strtotime('today 00:00:00');
and for the next 7 days i have
$this_week_start = $today; $this_week_end = strtotime('+7 today 23:59:59');
am i on the right tracks? What I'm unsure how to do is use the above to cycle through the next 7 days from $today and check for events?
Hope this makes sense
Would appreciate any help