I have a 3 dimensional array whose structure looks like the following. Let's call the inner-most arrays as records for clarity. I need to sort the outermost array in such a way that it gets sorted from newest to oldest.
Array (
[0] => Array (
[0] => Array (
[personNum] => 2
[type] => comment
[datetime] => 2019-05-15 11:29:45
),
[1] => Array (
[personNum] => 3
[type] => status
[datetime] => 2019-05-26 15:59:53
)
),
[1] => Array (
[0] => Array (
[personNum] => 3
[type] => status
[datetime] => 2019-05-26 15:59:53
)
[1] => Array (
[personNum] => 4
[type] => status
[datetime] => 2019-05-26 16:04:24
)
)
)
I have checked this and this links, and I know that custom functions is the way to go, and i am trying to understand it for 2D arrays but i am not getting a hang of how it would work for 3D arrays.