On Mon, 19 Feb 2001, Jason Greene wrote:
> > We can change in_array() to return the the key if it's found, and false
> > if it's not, but imagine all the scripts it would break..
> about 1/4th of mine : )
> 
> Well I think the basic problem is that people are using in_array against its 
>intention.
> It is a Boolean function, and that really shouldn't be changed. We could create 
>another
> function that is more designed for searching? perhaps array_find? I wouldn't mind 
>spending time on this if agreed upon.

Could be done. The way I'd do it is have one php_in_array() C function
that gets parameters passed through from in_array() and array_find() as
well as a flag indicating whether to just return true/false or the
actual key.

-Andrei

"The human brain is a wonderful thing. It starts working the moment you
are born, and never stops until you stand up to speak in public. " -- Sir
George Jessel

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