Unique items in an array
| From: | Marc Guay | Date: | Tue, 13 Dec 2011 21:15:49 +0000 |
| Subject: | Unique items in an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315993@lists.php.net to get a copy of this message | ||
Hi folks,
Let's say that I have the following array:
[0]=>
array(35) {
["contact_id"]=>
string(3) "356"
["contact_first_name"]=>
string(4) "Marc"
}
[1]=>
array(35) {
["contact_id"]=>
string(3) "247"
["contact_first_name"]=>
string(4) "Marc"
}
[2]=>
array(35) {
["contact_id"]=>
string(3) "356"
["contact_first_name"]=>
string(4) "Marc"
}
And I would like to filter out exact duplicates, such as key 0 and key
2 in this example, leaving me with an array containing only unique
entries. How would you go about it?
Thanks for any help,
Marc