I have the following array:
Array
(
[0] => Array
(
[0] => 2
[1] => 1
[2] => Text
[3] => 0
)
[1] => Array
(
[0] => 3
[1] => 1
[2] => Another Text
[3] => 0
)
}
I need to order the outter array by the value of the index number 2 of the inner array so it would be:
Array
(
[0] => Array
(
[0] => 2
[1] => 1
[2] => Another Text
[3] => 0
)
[1] => Array
(
[0] => 3
[1] => 1
[2] => Text
[3] => 0
)
}
I found methods like sort()
and array_multisort()
but it seems that they do not fit in this case. Also the original array has many items so it should be a fast algorithm.
Does php has any implemented method for this case?