I have two JSON encoded arrays
1st Array
{
"User_id":2,
"Seeds":["11","22","31","14"]
}
2nd Array
{
"Seeds": [
{
"Team_name": "Belmont Bruins",
"Team_id": "22",
},
{
"Team_name": "Arkansas State Red Wolves",
"Team_id": "14",
},
{
"Team_name": "Arizona Wildcats",
"Team_id": "11",
},
{
"Team_name": "Brown Bears",
"Team_id": "31",
}
]
}
Now i need to sort the 2nd array based on the 1st array. The 'Seeds' in the first array corresponds to 'Team_id' in the second array. The output required is:
{
"Seeds": [
{
"Team_name": "Arizona Wildcats",
"Team_id": "11",
},
{
"Team_name": "Belmont Bruins",
"Team_id": "22",
},
{
"Team_name": "Brown Bears",
"Team_id": "31",
},
{
"Team_name": "Arkansas State Red Wolves",
"Team_id": "14",
}
]
}
I have found similar questions. But the solutions dosn't seem to work in this case.