I want to sort the data in the array according to user input. Follow the example below. What do I have to do?
array data sample
0: Array
0: "1"
1: "text1"
2: "text2"
3: "text3"
1: Array
0: "2"
1: "text1"
2: "text2"
3: "text3"
2: Array
0: "3"
1: "text1"
2: "text2"
3: "text3"
text input: 3, 1, 2
result
0: Array
0: "3"
1: "text1"
2: "text2"
3: "text3"
1: Array
0: "1"
1: "text1"
2: "text2"
3: "text3"
2: Array
0: "2"
1: "text1"
2: "text2"
3: "text3"