How to sort this array by Forest name or by tree height exmaple:
Forest names are "Lake Forest" and "Central Forest" so the cities will be
sorted by their forest, so the City Object "Pogradec" will come first and than "Tirana",
as per heights of trees they should be sorted inside the forest and also
the city with the highest tree should should come first.
:
Array
(
[0] => City Object
(
[name] => Tirana
[forests] => Array
(
[0] => Forest Object
(
[name] => Lake Forest
[details] => Array
(
[0] => Tree Object
(
[name] => Black Ash
[height] => 5
)
[0] => Tree Object
(
[name] => White Ash
[height] => 7
)
)
)
)
)
[1] => City Object
(
[name] => Pogradec
[forests] => Array
(
[0] => Forest Object
(
[name] => Central Forest
[details] => Array
(
[0] => Tree Object
(
[name] => Black Ash
[height] => 13
)
[1] => Tree Object
(
[name] =>White Ash
[height] => 23
)
)
)
)
)
)