Re: Unique items in an array
| From: | Marc Guay | Date: | Tue, 13 Dec 2011 21:35:58 +0000 |
| Subject: | Re: Unique items in an array | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315997@lists.php.net to get a copy of this message | ||
> If the contact_id is the primary key, you could also use that as array
> index, which would automatically filter duplicates.
Thanks for this, it's so obvious I didn't see it. I was adding items
to the array with $array[] = $contact when I could have just as easily
used $array[$contact['id']] = $contact;
Cheerios,
Marc