AW: [PHP] removing duplicate entries from array
| From: | Steven Glogger | Date: | Fri, 21 Jul 2000 16:39:19 +0000 |
| Subject: | AW: [PHP] removing duplicate entries from array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7597@lists.php.net to get a copy of this message | ||
is there a list with all undocumentet features/functions?
this was very helpfull...
thx a lot
steven glogger
-----Ursprungliche Nachricht-----
Von: pour@mieterra.com [mailto:pour@mieterra.com]
Gesendet: Freitag, 21. Juli 2000 12:16
An: teo@digiro.net
Cc: php-general@lists.php.net
Betreff: Re: [PHP] removing duplicate entries from array
Hi,
An even faster way, if you use the latest php, is array_unique(), one of
the undocumented functions you can read briefly about at
http://www.zugeschaut-und-mitgebaut.de/php/function.array_unique.html.
Ciao,
Andreas
Teodor Cimpoesu wrote:
>
> Hi Steven!
> On Fri, 21 Jul 2000, Steven Glogger wrote:
>
> > is there a quick way to remove all double entries from a array?
> if you asked for a function nope,
> you can do smth. ~
> $a = array (1,1,2,2,3,3);
> $b = array ();
> foreach ($a as $k) {
> !in_array ($k,$b) && $b[] = $k;
> }
> $a = $b;
>
> -- teodor
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net