note 85320 modified in function.array-unique by danbrown
| From: | danbrown@php.net | Date: | Fri, 25 Jun 2010 15:24:08 +0000 |
| Subject: | note 85320 modified in function.array-unique by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170459@lists.php.net to get a copy of this message | ||
another method to get unique values is :
<?php
$alpha=array('a','b','c','a','b','d','e','f','f');
$alpha= array_keys(array_count_values($alpha));
print_r($alpha);
?>
Output:
Array ( [0] => a [1] => b [2] => c [3] => d [4] => e [5] => f )
--was--
another method to get unique values is :
$alpha=array('a','b','c','a','b','d','e','f','f');
$alpha= array_keys(array_count_values($alpha));
print_r($alpha);
Output:
Array ( [0] => a [1] => b [2] => c [3] => d [4] => e [5] => f )
http://php.net/manual/en/function.array-unique.php