This kind of a collection is called an associative array or a hash.
What you do is take all your keys and put them as values in another array, which you can then sort. Then you iterate through the sorted key values and use them as index to the original array, the net result being iterating the original array ordered by the keys' values. If you want the original array permanently sorted, you can rebuild it while doing this.
For an example,
see here.