RE: [PHP] Limiting an array to unique values
| From: | Alex Hogan | Date: | Tue, 06 Apr 2004 14:48:58 +0000 |
| Subject: | RE: [PHP] Limiting an array to unique values | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-182478@lists.php.net to get a copy of this message | ||
I guess I deserved that one...
alex hogan
> -----Original Message-----
> From: John W. Holmes [mailto:holmes072000@charter.net]
> Sent: Tuesday, April 06, 2004 9:40 AM
> To: Alex Hogan; PHP General list
> Subject: Re: [PHP] Limiting an array to unique values
>
> From: "Alex Hogan" <Alex.Hogan@AlliedElec.com>
> > 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?
>
> array_unique(). Imagine that. :)
>
> ---John Holmes...
******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************