在下面的数组中,您可以看到“listElemId”的顺序与数组中的前三个元素不同。我想要的是它们按顺序排列(listElem 1,2,3)。'listElemPoints' 当然应该跟随。
如何实现?
提前致谢!
$listArray {
[0] {
[0] {
["listElemId"] = 2 // <- should be 1
["listElemPoints"] = 1 }
[1] {
["listElemId"] = 3 // <- should be 2
["listElemPoints"] = 2 }
[2] {
["listElemId"] = 1 // <- should be 3
["listElemPoints"] = 3 }
}
[1] {
[0] {
["listElemId"] = 3 // <- should be 1
["listElemPoints"] = 1 }
[1] {
["listElemId"] = 2 // <- correct
["listElemPoints"] = 2 }
[2] {
["listElemId"] = 1 // <- should be 3
["listElemPoints"] = 3 }
}
[2] {
[0] {
["listElemId"] = 3 // <- should be 1
["listElemPoints"] = 1 }
[1] {
["listElemId"] = 1 // <- should be 2
["listElemPoints"] = 2 }
[2] {
["listElemId"] = 2 // <- should be 3
["listElemPoints"] = 3 }
}
}