Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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 )
 
PREVIOUS NEXT
Tagged: #duplicate #array #php
ADD COMMENT
Topic
Name
4+3 =