Answers for "get unique items in array with number of time are duplicated php"

PHP
1

get duplicate value from array php

$arr = array(1, 4, 6, 1, 8, 9, 4, 6);

$unique = array_unique($arr);

$duplicates = array_diff_assoc($arr, $unique);

print_r($duplicates);
Array ( [3] => 1 [6] => 4 [7] => 6 )
Posted by: Guest on October-08-2020
0

get unique array from multidimentional array by value in php

$uniquePids = array_unique(array_map(function ($i) { return $i['pid']; }, $holder));
Posted by: Guest on January-30-2021

Code answers related to "get unique items in array with number of time are duplicated php"

Browse Popular Code Answers by Language