title: most effective way to find positions of repeated values php
body: <p>I would like to the most effective way to get the position of repeated elements element in array. For example, if i have:</p>
  
  <p><code>$example = array('a','b','c','a','a','d');</code></p>
  
  <p>So in this case 'a' is at position 0 - 3 - 4. </p>
  
  <p>I know we can loop through but i think in it is ineffective. I would be grateful if you could show me a better way to do this.</p>
  
  <p>Thank you very much</p>