The array_unique
function will do this for you. You just needed to add the SORT_REGULAR
flag:
$items_thread = array_unique($items_thread, SORT_REGULAR);
However, as bren suggests, you should do this in SQL if possible.
More Related Contents:
- count how many duplicate keys are in array of objects?
- php: check if an array has duplicates
- 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]
- How do I use array_unique on an array of arrays?
- Return only duplicated entries from an array (case-insensitive)
- Isolate comma-separated values, remove duplicates and empty values, then sort
- Combine two 2d arrays and have duplicate rows removed
- Does array_unique() modify its array by reference?
- How to count the consecutive duplicate values in an array?
- PHP: Check for duplicate values in a multidimensional array
- fetch data inmultidimensional array in PHP [closed]
- Split a comma-delimited string into an array?
- How to convert JSON string to array
- Implode an array with “, ” and add “and ” before the last item
- PHP sort array by two field values [duplicate]
- Cartesian Product of N arrays
- Foreach loop inside array
- Create new variables from array keys in PHP
- Fastest way to add prefix to array keys?
- PHP order array by date? [duplicate]
- Returning Multiple Rows with MySqli and Arrays
- Using array_intersect on a multi-dimensional array
- Converting an array from one to multi-dimensional based on parent ID values
- Check whether an array is empty [duplicate]
- PHP: Split string into array, like explode with no delimiter
- How to create an empty array in PHP with predefined size?
- Convert PostgreSQL array to PHP array
- PHP: Most frequent value in array