note 110332 added to function.in-array

From: Date: Thu, 11 Oct 2012 18:58:45 +0000
Subject: note 110332 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-191255@lists.php.net to get a copy of this message
This worked best for me (had an array a needle with the integer 0 and in_array always found 0 in my empty array. function isInArray($needle, $myArray){ $found = false; for($i=0;$i<count($myArray);$i++){ if (strcmp($myArray[$i],$needle)==0){ $found = true; break; } } return $found; } ---- Server IP: 69.147.83.199 Probable Submitter: 109.90.170.40 ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- https://master.php.net/note/edit/110332 Del: integrated -- https://master.php.net/note/delete/110332/integrated Del: useless -- https://master.php.net/note/delete/110332/useless Del: bad code -- https://master.php.net/note/delete/110332/bad+code Del: spam -- https://master.php.net/note/delete/110332/spam Del: non-english -- https://master.php.net/note/delete/110332/non-english Del: in docs -- https://master.php.net/note/delete/110332/in+docs Del: other reasons-- https://master.php.net/note/delete/110332 Reject -- https://master.php.net/note/reject/110332 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191255) next »