On Tue, Dec 13, 2011 at 10:15 PM, Marc Guay <marc.g...@gmail.com> wrote:
> 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

If the contact_id is the primary key, you could also use that as array
index, which would automatically filter duplicates.
If you want to filter out duplicate names after that, you could use
array_unique for that.

Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to