title: Ranking/Position on value of array in PHP
body: <p>I have an array with these values, <code>Array ( [0] =&gt; 12 [1] =&gt; 17 [2] =&gt; 5 [3] =&gt; 27 [4] =&gt; 5 )</code> and I need to find out ranking/position of each value
  ie, </p>
  
  <pre><code>for 27 - Rank 1 
  for 17 - Rank 2 
  for 12 - Rank 3 
  for 5 - Rank 4 
  for 5 - Rank 4 (duplicate value in the array) 
  </code></pre>
  
  <p>and these need to be in the same order as the array, so that output should be as follow</p>
  
  <pre><code>12 - Rank 3 
  17 - Rank 2 
  5 - Rank 4 
  27 - Rank 1 
  5 - Rank 4 
  </code></pre>