function get_duplicates ($array) {
return array_unique( array_diff_assoc( $array, array_unique( $array ) ) );
}
More Related Contents:
- count how many duplicate keys are in array of objects?
- Filter array by its keys using an array of allowed keys
- Filter/Remove rows where column value is found more than once in a multidimensional array
- Remove all elements from array that do not start with a certain string
- Get difference between associative rows of two 2-dimensional arrays
- php: check if an array has duplicates
- Recursively remove empty elements and subarrays from a multi-dimensional array
- Will copy-on-write prevent data duplication on arrays?
- Get the keys for duplicate values in an array
- How to allow duplicate keys in php array [duplicate]
- Remove duplicate items from an array [duplicate]
- How to filter an associative array comparing keys with values in an indexed array?
- Explode string into array with no empty elements?
- Native function to filter array by prefix
- Checking if ANY of an array’s elements are in another array
- Isolate comma-separated values, remove duplicates and empty values, then sort
- Combine two 2d arrays and have duplicate rows removed
- Most efficient way to search for object in an array by a specific property’s value
- How to count the consecutive duplicate values in an array?
- PHP: Check for duplicate values in a multidimensional array
- array_diff to compare two associative arrays
- In PHP, how do you change the key of an array element?
- php $_POST array empty upon form submission
- How to generate in PHP all combinations of items in multiple arrays
- Search for a key in an array, recursively
- Get the first N elements of an array?
- Sort a flat, associative array by numeric values, then by non-numeric keys
- Returning first x items from array
- Prepend associative array elements to an associative array
- Remove zero values from a PHP array