I met a problem with array sorting.
My array's structure is like this:
array(4) {
  [1]=>
  array(5) {
    ["type"]=>
    string(4) "A"
    ["index"]=>
    int(1)
  }
  [2]=>
  array(5) {
    ["type"]=>
    string(4) "B"
    ["index"]=>
    int(4)
  }
  [3]=>
  array(5) {
    ["type"]=>
    string(4) "C"
    ["index"]=>
    int(2)
  }
  [4]=>
  array(5) {
    ["type"]=>
    string(4) "D"
    ["index"]=>
    int(3)
  }
}
As you can see, inside each child array, there's a key "index", and the value there was not in the correct order 1-2-3-4 but it's 1-4-2-3.
How I can sort this array so that its children arrays were listed in correct order ?
P.S.: The acutal array is much bigger&more complicated than this one.