I would like to check if my array has any duplicates and return the duplicated values in an array. I want this to be as efficient as possible.
Example:
in addition to gumbo's answer:
function returndup($arr) { return array_diff_key($arr, array_unique($arr)); }