Re: PHP 4.0 Bug #9337: make in_array return key, if searched value was found
| From: | Andrei Zmievski | Date: | Mon, 19 Feb 2001 16:20:52 +0000 |
| Subject: | Re: PHP 4.0 Bug #9337: make in_array return key, if searched value was found | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-46918@lists.php.net to get a copy of this message | ||
On Mon, 19 Feb 2001, sbergmann@php.net wrote:
> From: sbergmann@php.net
> Operating system:
> PHP version: 4.0.4pl1
> PHP Bug Type: Feature/Change Request
> Bug description: make in_array return key, if searched value was found
>
> in_array() currently returns only true/false on whether or not a searched-for value is in a
> given array.
>
> I would like it to return the key of the array's element when value was found, and false
> otherwise. This should not break existing code using in_array().
Really? What if the key is 0?
-Andrei
Commitment, n.:
Commitment can be illustrated by a breakfast of ham and eggs. The chicken
was involved, the pig was committed.