title: Sort and array maintaining index value
body: <ol>
  <li>I stored some values in the array as follows $score[$userIndex] = : </li>
  </ol>
  
  <p><code>Score [100, 400, 900]</code></p>
  
  <p><code>userIndex (1  , 2  ,  3 )</code></p>
  
  <p>I need to ascending numeric sort based on the score while maintaining the indexes, as they have significance, the result should resemble:</p>
  
  <pre><code>    Score [100, 400, 900]
  userIndex (2  , 1  ,  3 )
  </code></pre>
  
  <p>2. After the sort is complete how can I access the previous index an element was at(after the sort is complete I no longer need the score just the indexes)?
  In the sorted array all i need is for eg: <code>$sorted[0] = 2, $sorted[1] = 1, $sorted[3] = 3</code></p>