To get the unique values in an array: array_unique() function : array_unique « Data Structure « PHP






To get the unique values in an array: array_unique() function

 
<?
$countries= array('Germany' => 'German', 'France' => 'French', 'Spain' => 'Spanish'); 

$languages = array_unique($countries); 
printf("%s,", var_export($languages, TRUE)); 

?>
  
  








Related examples in the same category

1.array_unique( ) filters an array so that a value can only appear once.
2.Working with Unique Values