I should sort a multidimensional object, according to the index of a dimension, but also keeping the corresponding indices.
ACTUAL OBJECT STRUCTURE
object1[index1][index2][index3][index4][index5]
SORTING PRIORITY AT PRESENT (OBIVIOUSLY)
1st
[index1]
2nd
[index2]
3rd
[index3]
4th
[index4]
5th
[index5]
EXAMPLE (SORTING AT PRESENT)
1st - object1['1']['50']['0']['0.00']['ARTICOLO3']
2nd - object1['1']['51']['0']['0.00']['ARTICOLO2']
3rd - object1['1']['52']['0']['0.00']['ARTICOLO1']
RE-SORTING EXPECTED
1st
[index4]
2th
[index5]
3rd
[index3]
4th
[index1]
5th
[index2]
EXAMPLE (RE-SORTING BY INDEX5)
1st - object1['1']['52']['0']['0.00']['ARTICOLO1']
2nd - object1['1']['51']['0']['0.00']['ARTICOLO2']
3rd - object1['1']['50']['0']['0.00']['ARTICOLO3']