note 80438 added to function.array-search

From: Date: Wed, 16 Jan 2008 09:13:42 +0000
Subject: note 80438 added to function.array-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-135131@lists.php.net to get a copy of this message
in response to lancelot--du-lac at hotmail dot fr If you want to check if a value exists in an array you should use the in_array function. This will return true or false. array_search has to return the key else you will be forced to loop through the entire array just to find a key. ---- Server IP: 87.238.162.147 Probable Submitter: 213.219.183.119 ---- Manual Page -- http://www.php.net/manual/en/function.array-search.php Edit -- https://master.php.net/note/edit/80438 Del: integrated -- https://master.php.net/note/delete/80438/integrated Del: useless -- https://master.php.net/note/delete/80438/useless Del: bad code -- https://master.php.net/note/delete/80438/bad+code Del: spam -- https://master.php.net/note/delete/80438/spam Del: non-english -- https://master.php.net/note/delete/80438/non-english Del: in docs -- https://master.php.net/note/delete/80438/in+docs Del: other reasons-- https://master.php.net/note/delete/80438 Reject -- https://master.php.net/note/reject/80438 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135131) next »