note 38888 deleted from function.array-unique by didou
| From: | didou@php.net | Date: | Sat, 10 Jan 2004 15:25:53 +0000 |
| Subject: | note 38888 deleted from function.array-unique by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63268@lists.php.net to get a copy of this message | ||
Note Submitter: justin@booleangate.org
----
function unique_array_from_key($data, $key) {
// Returns an unique array of the values at $data[0...N][$key]
//
$a = array();
foreach ($data as $d) {
if ( !in_array($d[$key], $a) )
$a[] = $d[$key];
}
return $a;
}