9
I have the following array:
[
[
'schedules' => [
'monday' => 1,
'tuesday' => 1,
'wednesday' => 1,
'thursday' => 1,
'friday' => 1,
'saturday' => 0,
'sunday' => 1,
]
]
]
I'd like to rotate the elements of this array with the first key being the tomorrow. Let's say today was Wednesday, I'd want my array to look like this:
[
[
'schedules' => [
'thursday' => 1,
'friday' => 1,
'saturday' => 0,
'sunday' => 1,
'monday' => 1,
'tuesday' => 1,
'wednesday' => 1,
]
]
]
I already have the weekday available (e.g. a string 'thursday'). It gets passed into the function that I'm working with.