title: how to get the rightmost index value from an array with the same values using php
body: <p>I'm making a program to take fingerprint values using a winnowing algorithm. which is where I have to take the smallest value from an array. but not only the smallest, there are conditions where if you find the same value, the rightmost value will be taken along with the index value. example array (3,5,5,8,6,7). from this example, I want to take the index of the second number 5, which is index 2, not index 1.</p>
  
  <p>but when I try to get the same value as the rightmost position use the function min () in php, but the one I get is always the leftmost position.</p>
  
  <p>I expect the output of </p>
  
  <pre><code>$a = array(3,5,5,8,6,7,6);
  </code></pre>
  
  <p>be </p>
  
  <pre><code>[3,0], [5,2], [8,3], [6,6], [7,5]
  </code></pre>
  
  <p>but the actual output is </p>
  
  <pre><code>[3,0], [5,1], [8,3], [6,4], [7,5]
  </code></pre>