Re: Hash Functions API

From: Date: Thu, 12 Apr 2001 14:37:16 +0000
Subject: Re: Hash Functions API
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-51493@lists.php.net to get a copy of this message
At 01:40 AM 4/12/2001 -0400, Stig Sæther Bakken wrote:
["Brian Foddy" <bfoddy@mn.mediaone.net>] I've been looking everywhere for a good reference of how to read and update arrays. The Zend documentation (www.zend.com/apidoc) has descriptions of how to create an array, and how to add elements to it, but I can't find anything on how to simply read the values of an array. Mostly I want to write two functions: 1. Accept a provided 2 dimensional array and loop through
    every element, by primary index then an inner loop by the second index,
    sequentially.  I need to extract from the array the two keys and the
value. The keys will not be sequential, at least the primary. 2. Build a 2-d array, basically the reverse of 1 above. Build an array
     with specific primary and secondary indexes.  Again keys will not
    be sequential.
To make matters worse, I'd like the keys to be either integer or strings. I've looked through the zend_hash.h header, and a few functions look likely (zend_hash_move_forward, zend_hash_get_current_key). Those are the ones you want, plus zend_hash_get_current_data.
Also check out the _ex() functions. They give you more features. Andi

« previous php.dev (#51493) next »