Using the below for sorting a multidimensional array by screen name:
$sortArray = array();
foreach($members as $member){
foreach($member as $key=>$value)
uasort() should work for you
'Greg'),
array('screen_name'=>'Allen'),
array('screen_name'=>'dan'),
array('screen_name'=>'Brenda'),
);
// uasort() like a boss!
uasort($members, 'sort_by_screen_name');
print_r($members);
Output
Array
(
[1] => Array
(
[screen_name] => Allen
)
[3] => Array
(
[screen_name] => Brenda
)
[2] => Array
(
[screen_name] => dan
)
[0] => Array
(
[screen_name] => Greg
)
)
Note: the original array keys are preserved using this method. If you'd like the keys to be rewritten, you can simply use usort()
.