note 35988 deleted from function.array-search by didou

From: Date: Mon, 22 Sep 2003 08:10:36 +0000
Subject: note 35988 deleted from function.array-search by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56882@lists.php.net to get a copy of this message
Note Submitter: Cyrille ---- You can use array_search in an uncase sensitive way : $array = array("a", "A", "b", "hello"); $search_word = "a"; foreach($array as $key => $val) { if (strtolower($search_word) == strtolower($val)) { echo $val.' : '.$key.'<br>'; } }

« previous php.notes (#56882) next »