How to Find Duplicates in Array

Given an unsorted array. How to find duplicates in array using PHP. These types of questions are generally asked in interviews. Sometimes interviewer allows to use in-built function sometimes not.