title: Map an array of values to an array of each value's rank in the array
body: <p>I have a array like this:</p>
  
  <pre><code>$row_arr_1=array(7,9,5,10);
  </code></pre>
  
  <p>now I want to get the result array like this:</p>
  
  <pre><code>$row_arr_2=array(3,2,4,1);
  </code></pre>
  
  <p>Explanation: </p>
  
  <p>As <code>10</code> is the largest value in <code>row_arr_1</code>, then it will be replaced with value 1. </p>
  
  <p>Similarly, as <code>9</code> is the 2nd highest value of <code>row_arr_1</code>, then it will be replaced by 2 and so on.</p>
  
  <p>I tried to sort the values of <code>row_arr_1</code>  but the position is changed. </p>
  
  <p>How 
  can i get my desired result?</p>