php - how to sort a multidemensional array by an inner key -
i have enormous array pulling api battlefield bad company 2, , soldier stats can pulled multi dimensional array inner array each soldier, api sormats sorting soldiers name alphabetically, want sort them rank (which key within soldiers array). ive been trying figure out days, have ideas? (ie sort array $arr[players][][rank]
here bit of array
array ( [players] => array ( [0] => array ( [name] => bigjay517 [rank] => 29 [rank_name] => second lieutenant ii [veteran] => 0 [score] => 979440 [level] => 169 [kills] => 4134 [deaths] => 3813 [time] => 292457.42 [elo] => 319.297 [form] => 1 [date_lastupdate] => 2010-03-30t14:06:20+02:00 [count_updates] => 13 [general] => array ( [accuracy] => 0.332 [dogr] => 86 [dogt] => 166 [elo0] => 309.104 [elo1] => 230.849 [games] => 384 [goldedition] => 0 [losses] => 161 [sc_assault] => 146333 [sc_award] => 567190 [sc_bonus] => 35305 [sc_demo] => 96961 [sc_general] => 264700 [sc_objective] => 54740 [sc_recon] => 54202 [sc_squad] => 53210 [sc_support] => 70194 [sc_team] => 21215 [sc_vehicle] => 44560 [slevel] => 0 [spm] => 0 [spm0] => 0 [spm1] => 0 [srank] => 0 [sveteran] => 0 [teamkills] => 67 [udogt] => 0 [wins] => 223 )
you can sort array criteria using usort()
Comments
Post a Comment