On Tue, Feb 20, 2001 at 08:27:59AM -0600, Andrei Zmievski wrote:
> in_array() used to move the pointer to the entry found, but people
> complained about it so I remove it... :)

And I thought it was neat, can't please everyone I guess (:

There seems to be a general problem with array functions and people
that want the pointer to be preserved. Rather than making functions
always do this (which makes them slower and is generally a pain) or
adding extra options to a lot of functions, how about a function
for setting the pointer?

I could in order to save the position do $key = key($arr). To
restore it later, I could then do something like array_setpos($key).
I'm not sure if the Zend API allows for setting the position without
looping through the array though. If array_setpos() is passed a non-
existing key it should return FALSE, else TRUE.

What do you think?

Stig

-- 
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]

Reply via email to