Remove duplicated values
removes duplicated entries in a array (only first level)
<br/>
Warning this will remove all keys
function remove_duplicated_values($arr){
$_a = array();
while(list($key,$val) = each($arr)){
$_a[$val] = 1;
}
return array_keys($_a);
}
//Example:
remove_duplicated_values(array('a', 'b', 'c', 'a')); --> returns array('a','b','c')
Url: http://www.jonasjohn.de/snippets/php/remove-duplicated-values.htm
Language: PHP | User: ShareMySnippets | Created: Oct 16, 2013