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

From: Date: Wed, 21 Feb 2001 00:02:22 +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-47112@lists.php.net to get a copy of this message
ID: 9337 Updated by: jason Reported By: sbergmann@php.net Old-Status: Assigned Status: Closed Bug Type: Feature/Change Request Assigned To: jason@php.net Comments: Request complete, new function created called array_search in CVS. Check it out in snapshots. -Jason Previous Comments: --------------------------------------------------------------------------- [2001-02-19 13:12:45] jason@php.net Andrei and I descussed the possibility of creating a new function. I will explore this. -Jason --------------------------------------------------------------------------- [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 (#47112) next »