I have a multidimensional array that need to be sorted. I want this array first sorted based on count from high to low. But when count has the same value, sort by city alphabetically. I don't know how to do this.
The multidimensional array:
Array
(
[0] => Array
(
[id] => 2
[city] => c
[count] => 5
)
[1] => Array
(
[id] => 3
[city] => b
[count] => 10
)
[2] => Array
(
[id] => 4
[city] => a
[count] => 5
)
)
Any ideas?
EDIT:
this is the result that i want:
Array
(
[0] => Array
(
[id] => 3
[city] => b
[count] => 10
)
[1] => Array
(
[id] => 4
[city] => a
[count] => 5
)
[2] => Array
(
[id] => 2
[city] => c
[count] => 5
)
)