我有这个关联数组:
Arr = {
"ID1":{"Attr1":"b","Attr2":"5"},
"ID2":{"Attr1":"d","Attr2":"2"},
"ID3":{"Attr1":"h","Attr2":"8"}
}
我想用属性 2 按数字而不是按降序对 ID 进行排序以获得此结果:
Arr = {
"ID3":{"Attr1":"h","Attr2":"8"}
"ID1":{"Attr1":"b","Attr2":"5"},
"ID2":{"Attr1":"d","Attr2":"2"},
}
如果这可能?