title: Get the keys for duplicate values in an array
body: <p>I have the following array: </p>
  
  <pre><code>$myarray = Array("2011-06-21", "2011-06-22", "2011-06-22", "2011-06-23", "2011-06-23", "2011-06-24", "2011-06-24", "2011-06-25", "2011-06-25", "2011-06-26");
  var_dump($myarray);
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Array (
      [0] =&gt; 2011-06-21
      [1] =&gt; 2011-06-22
      [2] =&gt; 2011-06-22
      [3] =&gt; 2011-06-23
      [4] =&gt; 2011-06-23
      [5] =&gt; 2011-06-24
      [6] =&gt; 2011-06-24
      [7] =&gt; 2011-06-25
      [8] =&gt; 2011-06-25
      [9] =&gt; 2011-06-26
  )
  </code></pre>
  
  <ol>
  <li>Now how can I display the keys with duplicate values? Here the function should NOT return ([0],[9]) since there are no duplicates with the values.</li>
  <li>How to find the keys for the same value, eg. for "2011-06-25" it should return [7],[8]</li>
  </ol>