Many time we get the array with contains the duplicate value. how we can find that duplicate value form array and remove it easily. we can remove duplicate value from the array using
array_unique() function of PHP. Let’s the example If our array look like.
$array = array( "a" => "First", "Second", "b" => "First", "Third", "Second", "Four" ); $array = array_unique($array); echo '<pre>'; print_r($array); exit;
The output after removing duplicate value form array is below
Array ( [a] => First  => Second  => Third  => Four )
If you have any question write the comment below.