Remove duplicate items in multi-dimension array in PHP

Remove duplicate items in multi-dimension array in PHP

Posted: 9 years ago in  PHP |


In PHP, array_unique only applied to signle dimension array


Here is clean way to make multi-dimension array unique

$input = array_map("unserialize", array_unique(array_map("serialize", $input)));