title: How to sort an array in this way in php
body: <p>like the function usort in php
  but if two members compare as equal, their key should be same.
  for example:
  $arrayToSort = array(2,6,1,3,3);</p>
  
  <p>after sort return</p>
  
  <pre><code>array
    1 =&gt;  1
    2 =&gt;  2
    3 =&gt;  3
    3 =&gt;  3
    4 =&gt;  6
  </code></pre>