Hash Functions API

From: Date: Thu, 12 Apr 2001 02:51:01 +0000
Subject: Hash Functions API
Groups: php.dev 
Request: Send a blank email to php-dev+get-51481@lists.php.net to get a copy of this message
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). But its hard knowing if these are the best to use and exactly how to use them. One more question, very simple. What is the difference between zend_hash_find and quick_find? I assume index_find lets me specify an integer (ie: array[3] in C notation). Have I missed the docs on these functions somewhere? Thanks for help. Brian

« previous php.dev (#51481) next »