I'm looking for an answer on something I've been literally spending my whole weekend on, and been struggling to find the right way to do it.
Say I have this PHP array:
Array (
[0] => 0
[1] => 182
[2] => 185
[3] => 0
[4] => 187
[5] => 0
[6] => 0
)
The key for each row of this array is a day, based on the numeric representation of the day of the week (1 = Monday, 2 = Tuesday, etc.).
I want to get the value for today's day, but if it's empty, I want to get the next non-zero value. It also needs to reset back to Sunday (0) if Saturday (6) equals 0.
Please help :S