[prev in list] [next in list] [prev in thread] [next in thread]
List: phpdoc
Subject: Re: [PHP-DOC] a question about Array
From: Rasmus Lerdorf <rasmus () php ! net>
Date: 2000-06-29 8:48:53
[Download RAW message or body]
> ----- Original Message -----
> From: Rasmus Lerdorf <rasmus@php.net>
> To: Lesche & Song <teehaus@asien-pazifik.de>
> Cc: <phpdoc@lists.php.net>
> 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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic