I have a multidimensionnal array of objects:
0 =>
array
32281 => object ...
105145 => object ...
165656 => object ...
194124 => object ...
195397 => object ...
205859 => object ...
1 =>
array
32281 => object ...
91504 => object ...
165656 => object ...
194124 => object ...
195397 => object ...
205859 => object ...
3 =>
array
32281 => object ...
105145 => object ...
165656 => object ...
194124 => object ...
195397 => object ...
205859 => object ...
and I want to remove duplicate arrays from this array like this (in this case I will remove 1 and just have 0 and 3 because 0 and 1 are the same) :
0 =>
array
32281 => object ...
105145 => object ...
165656 => object ...
194124 => object ...
195397 => object ...
205859 => object ...
3 =>
array
32281 => object ...
91504 => object ...
165656 => object ...
194124 => object ...
195397 => object ...
205859 => object ...
I have tried unsuccessfully a lot of things with array_unique, array_keys, array_keys_exists...
for example :
$array = array_map("unserialize", array_unique(array_map("serialize", $array)));
or
$result = array();
foreach ($array as $key => $value) {
if(!array_key_exists($key,$result))
$result[$key] = $array[$key];
}