Re: PHP 4.0 Bug #9337 Updated: make in_array return key, if searched value was found
| From: | Andrei Zmievski | Date: | Mon, 19 Feb 2001 17:36:29 +0000 |
| Subject: | Re: PHP 4.0 Bug #9337 Updated: make in_array return key, if searched value was found | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-46931@lists.php.net to get a copy of this message | ||
On Mon, 19 Feb 2001, André Langhorst wrote:
> > How about using array_keys($array, $value) to find the key?
>
> obviously it is cheaper to let in_array return it and it is more php 4
> stylish, we have booleans, why not use them?
>
> if ($key=in_array()) do_someting_with_key($key);
So, you suggest putting in 4th parameter? Then someone on php-general
suggested a few months ago to put in another parameter that controls
whether in_array() moves internal pointer or not.. Too many parameters.
-Andrei
* Power corrupts. Atomic power corrupts atomically. *