0
Array
(
    [n] => Unover
    [i] => 250
)
Array
(
    [n] => Un
    [i] => 195
)
Array
(
    [n] => Iliad
    [i] => 110
)

They are in the form of $arr['Unover']['i'].

I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where to start.

Need to be able to get it into another array that I can just foreach through in orde

jmoon
  • 606
  • 3
  • 7
  • 18

2 Answers2

0

Sort an array by a child array's value - that should get you going

Community
  • 1
  • 1
Tak
  • 11,428
  • 5
  • 29
  • 48
0
usort($array, function ($a, $b) { return $a['i'] - $b['i']; });

http://php.net/usort

deceze
  • 510,633
  • 85
  • 743
  • 889
  • @jmoon If you can, you should use 5.3 anyway. You can use [`create_function`](http://php.net/create_function) for 5.2-. – deceze Jul 06 '11 at 01:38