How can I write a functional to alphabetize a multidimensional array such that the first sort is by ‘building name’ then ‘last_name’, then ‘first_name’
[70] =>
Array (
[id] => 635
[name] => Mick Kruzic
[dob] => 11/05/1968
[building_name] =>
[department] =>
[phone_ext] =>
[team_name] =>
[team_leader] =>
[party_registered] =>
[total_points] => 0
[total_tickets] => 0
[awarded_prizes] => 0
[processing_prizes] => 0
)
The function you want to look into is array_multisort(). http://php.net/manual/en/function.array-multisort.php
You can use it to sort a multi dimensional array, or sort several arrays together.
Make an array of just the keys you wish to sort by then use that array as the second parameter.
so for example if you whole array was $data: