I need to sort an array like this
[0] => Array
(
[id] => 5
[stats] => Array
(
[SessionsPlayed] => 1
)
)
[1] => Array
(
[id] => 88
[stats] => Array
(
[SessionsPlayed] => 6
)
)
[2] => Array
(
[id] => 22
[stats] => Array
(
[SessionsPlayed] => 9
)
)
So that it is in descending order by the SessionPlayed column like this.
[2] => Array
(
[id] => 22
[stats] => Array
(
[SessionsPlayed] => 9
)
)
[1] => Array
(
[id] => 88
[stats] => Array
(
[SessionsPlayed] => 6
)
)
[0] => Array
(
[id] => 5
[stats] => Array
(
[SessionsPlayed] => 1
)
)
I have attempted to look online on how to solve this but all of the answer I find can only sort down one child ( ex. the id column ) Here are the posts I looked at. https://stackoverflow.com/a/16788610/1319033 https://stackoverflow.com/a/2699110/1319033