PHP 4.0 Bug #9337 Updated: make in_array return key, if searched value was found

From: Date: Mon, 19 Feb 2001 18:12:45 +0000
Subject: PHP 4.0 Bug #9337 Updated: make in_array return key, if searched value was found
Groups: php.dev 
Request: Send a blank email to php-dev+get-46939@lists.php.net to get a copy of this message
ID: 9337 Updated by: jason Reported By: sbergmann@php.net Old-Status: Feedback Status: Assigned Bug Type: Feature/Change Request Assigned To: jason@inetgurus.net Comments: Andrei and I descussed the possibility of creating a new function. I will explore this. -Jason Previous Comments: --------------------------------------------------------------------------- [2001-02-19 12:18:06] andre@php.net maybe a fourth parameter switch to avoid 0->false problems? --------------------------------------------------------------------------- [2001-02-19 11:18:18] sbergmann@php.net 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(). --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9337&edit=2

« previous php.dev (#46939) next »