Hi everyone. I have an array of arrays that contain a users name, email, website, and the number of occurrences. To give you a better idea, it looks something like this: $top_commentors= array(); $commentor= array("Name"=>"dummy", "Email"=>"dummy", "Website"=>"dummy.com", "Count"=>3); $commentor's get pushed into $top_commentors. My question is, once I have this array of $top_commentors that contains this info, how can I sort it so that the commentor with the highest count will be at the top? Thanks for any help!
Didn't test, but something like this; <? $top_commentors =array( array("Name"=>"dummy", "Email"=>"dummy", "Website"=>"dummy.com", "Count"=>3), array("Name"=>"dummy", "Email"=>"dummy2", "Website"=>"dummy.com", "Count"=>1), array("Name"=>"dummy", "Email"=>"dummy3", "Website"=>"dummy.com", "Count"=>10)); $count=array(); foreach($top_commentors as $k=>$v) { $count[$k] = $v['Count']; } array_multisort($count, SORT_DESC, SORT_NUMERIC, $top_commentors); print_r($top_commentors); ?>