Re: [PHP-DOC] a question about Array From: Rasmus Lerdorf (rasmus <email protected>)
Date: 06/29/00

> ----- Original Message -----
> From: Rasmus Lerdorf <rasmus <email protected>>
> To: Lesche & Song <teehaus <email protected>>
> Cc: <phpdoc <email protected>>
> Sent: Thursday, June 29, 2000 10:13 AM
> Subject: Re: [PHP-DOC] a question about Array
>
>
> > > How can I transtorm an array including repeating/multiple values into
> > > an array with distinct values? ({1,2,2,3,4,4,5} =>{1,2,3,4,5})
> >
> > Please do not ask questions like this on the phpdoc list.
> >
> > And see the array_flip() function.
> >
> > -Rasmus
>
> array_flip() ??? I think you meant array_unique().

No I didn't actually:

        $a = array(1,2,2,3,4,4,5);
        $b = array_flip($a);
        while(list($v,)=each($b)) echo $v;

This prints: 12345

-Rasmus