Re: Limiting an array to unique values
| From: | joel boonstra | Date: | Tue, 06 Apr 2004 14:29:43 +0000 |
| Subject: | Re: Limiting an array to unique values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182475@lists.php.net to get a copy of this message | ||
On Tue, Apr 06, 2004 at 09:27:31AM -0500, Alex Hogan wrote:
> Hi All,
>
> I have an array that I am using as a parameter for a query in a where
> clause.
>
> The array has values that are like this.
>
> Item 1
> Item 2
> Item 3
> Item 1
> Item 3
> Item 3
> Item 1
>
> What I need to have is unique values only.
>
> Item 1
> Item 2
> Item 3
>
> How can I sort out the redundant values in that array?
PHP's 'array_unique' function should help:
http://php.net/array_unique
--
[ joel boonstra | gospelcom.net ]