note 44054 added to function.in-array

From: Date: Tue, 13 Jul 2004 18:56:05 +0000
Subject: note 44054 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-73182@lists.php.net to get a copy of this message
Let's give you a (working!) case insensitive version of the in_array(); function. <?php function in_array_ci($item,$array) { $object_found = false; foreach($array as $arrayvalue) { if(strtoupper($item) == strtoupper($arrayvalue)) { $object_found = true; } } return $object_found; } ?> Timmie ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44054 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44054&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44054&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73182) next »