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)));
Related Contents:
- How to remove duplicate values from an array in PHP
- How to order “zebra” array so each key has an alternate value (either 1, 0)
- How can I access an array/object?
- How to access and manipulate multi-dimensional array by key names / path?
- Split a comma-delimited string into an array?
- How to “flatten” a multi-dimensional array to simple one in PHP? [duplicate]
- How to generate in PHP all combinations of items in multiple arrays
- Get the first element of an array
- How do I create a comma-separated list from an array in PHP?
- How create an array from the output of an array printed with print_r?
- How do you reindex an array in PHP but with indexes starting from 1?
- Insert array into MySQL database with PHP
- Find a matching or closest value in an array
- How to create an array from a CSV file using PHP and the fgetcsv function
- create array tree from array list [duplicate]
- PHP – Accessing Multidimensional Array Values
- What’s the best way to get the last element of an array without deleting it?
- PHP: How to remove specific element from an array?
- Convert array into csv
- How to access mysql result set data with a foreach loop
- Get the first N elements of an array?
- filter values from an array similar to SQL LIKE ‘%search%’ using PHP
- How to sort a date array in PHP
- PHP foreach with Nested Array?
- How can I echo or print an array in PHP?
- Convert array of single-element arrays to a one-dimensional array
- array_unique for objects?
- Add elements to array which has gapped numeric keys to form an indexed array / list
- Recursively remove empty elements and subarrays from a multi-dimensional array
- Chunk and transpose a flat array into rows with a specific number of columns
- Checking if all the array items are empty PHP
- Convert flat array to the multi-dimensional
- Nested array. Third level is disappearing
- PHP case-insensitive in_array function
- how to pass an array in GET in PHP?
- Group 2d array data using column value to create a 3d array
- PHP – Get key name of array value
- Merging two arrays with the “+” (array union operator) How does it work?
- using array_search for multi dimensional array
- Find number which is greater than or equal to N in an array
- Why does this PHP code just echo “Array”?
- How to allow duplicate keys in php array [duplicate]
- Pass array literal to PostgreSQL function
- Check if string contains word in array [duplicate]
- How to explode only on the last occurring delimiter?
- Algorithm to get all possible string combinations from array up to certain length
- Warning: array_combine(): Both parameters should have an equal number of elements
- MySQL PHP – SELECT WHERE id = array()? [duplicate]
- Loop a multidimensional array and only print two specific column values per row
- Print the keys of an array