I have a PHP array of days of the week:
$dow = array( 2, 3, 4, 6, 7 );
This array is generated dynamically. So it may be the values above, or it may be a slightly altered version.
I need to show the next week, with the days in that array highlighted, but it needs to be done starting with the current day.
So if today's day of the week is later, and I use the above array to get the next Tuesday, Wednesday, etc, then I end up missing the end of the current week.
Super short example:
$today = date();
foreach $dow as $id => $weekday:
// display next $weekday after $today
endforeach;
So if today is Wednesday, then this will end up skipping Thurs, Sat, and Sun and start with Tuesday.
I can only figure out two possible ways to do this, and I'm not sure how to do either one. Either sort the array starting with the next day of the week and put the other ones at the end of the array, or get the starting position, loop through the rest of the array, then loop through the array again until I've hit that starting position.
How do I get the next week's worth of these days?