Answers for "how to remove duplicate in php array"

PHP
1

php remove duplicates from multidimensional array

$serialized = array_map('serialize', $targetArray);
$unique = array_unique($serialized);
return array_intersect_key($targetArray, $unique);
Posted by: Guest on December-08-2021
0

how to remove duplicate values from a multidimensional array in php

We used this to de-duplicate results from a variety of overlapping queries.

$input = array_map("unserialize", array_unique(array_map("serialize", $input)));
Posted by: Guest on January-13-2021

Code answers related to "how to remove duplicate in php array"

Browse Popular Code Answers by Language