Re: [PHP-DEV] Re: zend_hash_sort_ex() From: Andi Gutmans (andi <email protected>)
Date: 10/26/99

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 <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>