Re: Re: zend_hash_sort_ex()

From: Date: Tue, 26 Oct 1999 20:38:26 +0000
Subject: Re: Re: zend_hash_sort_ex()
References: 1 2 3 4 5 6 7 8 9  Groups: php.dev 
Request: Send a blank email to php-dev+get-11928@lists.php.net to get a copy of this message
At 03:23 PM 10/26/99 -0500, Andrei Zmievski wrote:
On Tue, 26 Oct 1999, Andi Gutmans wrote: I think the only way to do it is to have your sort function receive a list of keys which you want sorted first, and it'll sort them in order and put all the rest at the end of the list (or leave them where they are). If I sort a hash on values, how will the elements be arranged in the list? What does zend_hash_rehash() do?
if "renumber" is true, you ask the hash_sort() function to sort by value and discard the previous keys, assigning new keys according to the new order. As a result of the keys changing hash_sort() calls hash_rehash() which assigns all of the new key/value pairs to their new bucket which is calculated according to the new key. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#11928) next »