title: Show only duplicate elements from an array
body: <p>I have an sorted array which contains first names of people.
  This array has lots of names which are same. </p>
  
  <p>I want to output only duplicate names.</p>
  
  <p>Example,</p>
  
  <p>input array:</p>
  
  <pre>
  Array
  (
      [0] => Abbas
      [1] => Abhay
      [2] => Abhinav
      [3] => Abhishek
      [4] => Aditya
      [5] => Ahmed
      [6] => Ahmed
      [7] => Ajay
      [8] => Ajay
  }
  </pre>
  
  <p>It should return</p>
  
  <pre>
  Array
  (
      [5] => Ahmed
      [6] => Ahmed
      [7] => Ajay
      [8] => Ajay
  }
  </pre>