I have a four dimensional array
To access one value from my array I would use the following code:
$class = $schedule[$week][$day][$room][$hour];
I would like to be able to pull all the values for a specific week, day, and hour for a range of rooms into a smaller array without restructuring my array.
I was thinking something like:
$classes = $schedule[$week][$day][range(1,10)][$hour];
How would I achieve something like this?
not sure if it’s what you want:
that will echo room from 1 to 10
you can also store the 10 room in
Arraylike: