At 01:40 AM 4/12/2001 -0400, Stig Sæther Bakken wrote:
>["Brian Foddy" <[EMAIL PROTECTED]>]
> > 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
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]