Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to remove from a multidimensional array all duplicate elements including the original

<?php

$unique_ids = array_count_values(array_column($array,'id'));
$res = array_filter($array, fn($v) => $unique_ids[$v['id']] === 1);
print_r($res);
 
PREVIOUS NEXT
Tagged: #How #remove #multidimensional #array #duplicate #elements #including #original
ADD COMMENT
Topic
Name
5+5 =