Re: array_unique and some questions on Zend hash internals

From: Date: Sun, 04 Jun 2000 16:57:35 +0000
Subject: Re: array_unique and some questions on Zend hash internals
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-20193@lists.php.net to get a copy of this message
AZ>> I think there is no point in preserving keys here, because you will end AZ>> up with a key for only the remaining item and which item it is may be AZ>> implementation dependent, i.e. first in the group, last in the group, AZ>> etc. There could be a situation where it doesn't matter which key do you get, as soon as you have one of them. For example, you have array of "news headline" => "date" and you want to display one headline for each date. Key-preserving unique function would serve you very good - as long as you don't care which one you are displaying (and if you are displaying just one, you don't care anyway). -- Stanislav Malyshev stas@zend.com +972-3-6139665

« previous php.dev (#20193) next »