並べ替えたい次の多次元配列があります。
最も内側の配列をtotal_pointsで並べ替えてから、tiebraker1、2、3で並べ替えたい
例:
Array
(
[1] => Array
(
[1] => Array
(
[userid] => 17
[total_points] => 16
[tiebraker1] => 1
[tiebraker2] => 2
[tiebraker3] => 1
)
[2] => Array
(
[userid] => 29
[total_points] => 16
[tiebraker1] => 1
[tiebraker2] => 2
[tiebraker3] => 9
)
)
[2] => Array
(
[1] => Array
(
[userid] => 26
[total_points] => 26
[tiebraker1] => 2
[tiebraker2] => 2
[tiebraker3] => 4
)
[2] => Array
(
[userid] => 17
[total_points] => 26
[tiebraker1] => 3
[tiebraker2] => 2
[tiebraker3] => 4
)
)
)
結果:
Array
(
[1] => Array
(
[1] => Array
(
[userid] => 29
[total_points] => 16
[tiebraker1] => 1
[tiebraker2] => 2
[tiebraker3] => 9
)
[2] => Array
(
[userid] => 17
[total_points] => 16
[tiebraker1] => 1
[tiebraker2] => 2
[tiebraker3] => 1
)
)
[2] => Array
(
[1] => Array
(
[userid] => 17
[total_points] => 26
[tiebraker1] => 3
[tiebraker2] => 2
[tiebraker3] => 4
)
[2] => Array
(
[userid] => 26
[total_points] => 26
[tiebraker1] => 2
[tiebraker2] => 2
[tiebraker3] => 4
)
)
)
array_multisortを使用してみましたが、正しく構成できません。
よろしくお願いします!