I'm not trying to start a flamewar either, but you're
just not getting it.
asort is doing exactly what it describes: "sorts an array such that array indices maintain their correlation with the array elements they are associated with." That's talking about how a key is paired with its value. Nothing else.
The fact that there are many identical values may be confusing you. The values in the sorted once and the sorted twice array
look the same, but if you think of them in terms of "value #0", "value #1", and "value #2" then the order is different. The actual values are the same, but the order in which they are presented is different.
Say you have four apples, each with a sticker with a number (1, 2, 3, or 4). Three identical red apples and one green apple. Now you give them to some guy ("sort") to arrange in order of color.
What he does is sort them so the red ones come first, but he also took off the stickers and reapplied them so that the first red apple is #1, second is #2, and third is #3. He completely forgot which sticker originally came on which apple.
Now say you don't like that. Say that the number on the apple also means something else: like which tree it came from. If the guy takes off the stickers then you lose that information. You need the stickers to stay on.
So instead you give the four apples to this other guy ("asort"). He sorts the apples into the
exact same order that the first guy did, except he didn't resticker the apples according to their new order. When you get the apples back you see that apple #3 is first, #2 is second, and #1 is third.
As far as you should care, the apples are in the correct order: three red ones then the green one. The fact that the numbers on the stickers are out of order shouldn't matter - you were sorting by
color, not
number.
If the numbers are in reverse order, it's just a side effect of how the guy sorted the apples. If you handed him the green one first, or if you gave him a red, the green, then the other two reds, the order could easily be different. Maybe #2, green, #1, #3. Unless you ask the guy exactly how he sorts apples you can't know about which order the stickers will come back in.
If you want it so that the sticker numbers are arranged in order according to which order you handed the apples to the sorting guy then you need a third guy ("usort") instead. This guy wants more money, but he'll sort according to exactly how you describe it to him. If you want the red apples first, okay. If you want the apples sorted by sticker number, okay. If you want both of those at the same time (first by color, then by number), that'll work too.