I have an array where I'm testing for duplicate values. I want to get an array of only the duplicate values, to give an error message to the user, noting which are the offending values. I tried
$duplicates = array_diff( $array_with_dupes, array_unique($array_with_dupes) );
But that didn't return the only the duplicate values -- instead I got an empty array.
What's a simple way to do this?