[ create a new paste ] login | about

Link: http://codepad.org/Uu21y6jf    [ raw code | output | fork ]

PHP, pasted on Jun 9:
1
2
3
4
5
6
7
8
9
<?php 
$array1 = array('foo', 'bar', 'xyzzy', 'xyzzy', 'xyzzy'); 

$dup = array_unique(array_diff_assoc($array1,array_unique($array1))); 

$result = array_diff($array1, $dup);

print_r($result);
?> 


Output:
1
2
3
4
5
6
Array
(
    [0] => foo
    [1] => bar
)
 


Create a new paste based on this one


Comments: