Return to Snippet

Revision: 29122
at July 22, 2010 08:32 by Moridin

Initial Code
// remove duplicate elements from n-dimensional arrays
function uniqueArray($nDimArray) {

    foreach($nDimArray as &$val) {
        $val = serialize($val);
    $nDimArray = array_unique($nDimArray);
    foreach($nDimArray as &$val) {
        $val = unserialize($val);
    return $nDimArray;

Initial URL

Initial Description
Courtesy of Dorphalsig on (see URL above)

Initial Title
Eliminate Duplicates in Multi-Dimensional Arrays

Initial Tags

Initial Language