Here is another way. No intermediate variables are saved.
We used this to de-duplicate results from a variety of overlapping queries.
$input = array_map("unserialize", array_unique(array_map("serialize", $input)));
More Related Contents:
- How to remove duplicate values from an array in PHP
- PHP create new array by value
- Get first and second element of array [duplicate]
- PHP Multidimensional associative array to HTML table
- count how many duplicate keys are in array of objects?
- How to get a form input array into a PHP array
- How do I create a comma-separated list from an array in PHP?
- Array to String PHP?
- PHP array delete by value (not key)
- How to access mysql result set data with a foreach loop
- How do you remove an array element in a foreach loop?
- How to insert an item at the beginning of an array in PHP?
- php: check if an array has duplicates
- How to sort a date array in PHP
- PHP Sort array by field? [duplicate]
- Get the keys for duplicate values in an array
- How can you make a multidimensional array unique? [duplicate]
- Efficiently pick n random elements from PHP array (without shuffle)
- PHP get index of last inserted item in array
- Search and replace multiple values with multiple/different values in PHP5?
- PHP Recursively unset array keys if match
- $_POST max array size
- PHP: Get the key from an array in a foreach loop [duplicate]
- Group 2d array data by one column and sum other columns in each group (separately)
- Efficiency of using foreach loops to clear a PHP array’s values
- Find min/max in a two dimensional array
- how to sort a multidemensional array by an inner key
- how to change the array key to start from 1 instead of 0 [duplicate]
- How to remove values from two arrays that have the same key and value?
- Create PHP array from MySQL column