Basically title is the questions itself. I have a collection, which stores arrays in one of the field. I made a sorting algorithm to sort out those arrays and the result is sorted array:
array:8 [▼
3 => array:5 [▼
5 => 100
1 => 50
2 => 30
3 => 20
4 => 10
]
6 => array:5 [▼
1 => 100
5 => 50
3 => 30
4 => 20
2 => 10
]
2 => array:5 [▼
3 => 100
5 => 50
4 => 30
1 => 20
2 => 10
]
The index of this array 3,6,2 is the ID of the collection. How can I order collection based on this ID's in same order as array ?