note 101595 modified in function.array-search by danbrown

From: Date: Tue, 28 Dec 2010 21:38:22 +0000
Subject: note 101595 modified in function.array-search by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-175288@lists.php.net to get a copy of this message
for case insensitive array_search you could use: <?php function array_search_i($str,$array){ foreach($array as $key => $value) { if(stristr($str,$value)) return $key; } return false; } ?> --was-- for case insensitive array_search you could use: <? function array_search_i($str,$array){ foreach($array as $key => $value) { if(stristr($str,$value)) return $key; } return false; } ?> http://php.net/manual/en/function.array-search.php

« previous php.notes (#175288) next »