My array looks like this
Array
(
[0] => Array
(
[last_name] => Kournikova
[first_name] => Anna
[gender] => Female
[date_of_birth] => 6/3/1975
[favorite_color] => Red
)
[1] => Array
(
[last_name] => Hingis
[first_name] => Martina
[gender] => Female
[date_of_birth] => 4/2/1979
[favorite_color] => Green
)
[2] => Array
(
[last_name] => Seles
[first_name] => Monica
[gender] => Female
[date_of_birth] => 12/2/1973
[favorite_color] => Black
)
[3] => Array
(
[last_name] => Abercrombie
[first_name] => Neil
[gender] => Male
[date_of_birth] => 2/13/1943
[favorite_color] => Tan
)
[4] => Array
(
[last_name] => Bishop
[first_name] => Timothy
[gender] => Male
[date_of_birth] => 4/23/1967
[favorite_color] => Yellow
)
[5] => Array
(
[last_name] => Kelly
[first_name] => Sue
[gender] => Female
[date_of_birth] => 7/12/1959
[favorite_color] => Pink
)
[6] => Array
(
[last_name] => Smith
[first_name] => Steve
[gender] => Male
[date_of_birth] => 3/3/1985
[favorite_color] => Red
)
[7] => Array
(
[last_name] => Bonk
[first_name] => Radek
[gender] => Male
[date_of_birth] => 6/3/1975
[favorite_color] => Green
)
[8] => Array
(
[last_name] => Bouillon
[first_name] => Francis
[gender] => Male
[date_of_birth] => 6/3/1975
[favorite_color] => Blue
)
)
The outcome is this
Kournikova Anna Female 6/3/1975 Red
Hingis Martina Female 4/2/1979 Green
Seles Monica Female 12/2/1973 Black
Abercrombie Neil Male 2/13/1943 Tan
Bishop Timothy Male 4/23/1967 Yellow
Kelly Sue Female 7/12/1959 Pink
Smith Steve Male 3/3/1985 Red
Bonk Radek Male 6/3/1975 Green
Bouillon Francis Male 6/3/1975 Blue
I want the outcome to be Females before Males by last_name ascending
Hingis Martina Female 4/2/1979 Green
Kelly Sue Female 7/12/1959 Pink
Kournikova Anna Female 6/3/1975 Red
Seles Monica Female 12/2/1973 Black
Abercrombie Neil Male 2/13/1943 Tan
Bishop Timothy Male 4/23/1967 Yellow
Bonk Radek Male 6/3/1975 Green
Bouillon Francis Male 6/3/1975 Blue
Smith Steve Male 3/3/1985 Red
How can I apply usort()
to sort them by that order?