php array unique multidimensional code example

Example 1: array_unique multidimensional php

";
print_r($arr);
echo "unique*********************
"; print_r(super_unique($arr,'titel')); ?>

Example 2: 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)));

Example 3: get unique array from multidimentional array by value in php

$uniquePids = array_unique(array_map(function ($i) { return $i['pid']; }, $holder));

Example 4: Array_unique multidimensional PHP

Array
(
    [0] => Array
        (
            [id] => 1
            [value] => 111
        )
 
    [1] => Array
        (
            [id] => 2
            [value] => 222
        )
 
    [2] => Array
        (
            [id] => 3
            [value] => 333
        )
 
    [3] => Array
        (
            [id] => 1
            [value] => 111
        )
 
)

Tags:

Misc Example