3 * @version $Id: stristr.php,v 1.1 2006/02/25 13:50:17 harryf Exp $
8 //---------------------------------------------------------------
10 * UTF-8 aware alternative to stristr
11 * Find first occurrence of a string using case insensitive comparison
12 * Note: requires utf8_strtolower
16 * @see http://www.php.net/strcasecmp
17 * @see utf8_strtolower
21 function utf8_stristr($str, $search) {
23 if ( strlen($search) == 0 ) {
27 $lstr = utf8_strtolower($str);
28 $lsearch = utf8_strtolower($search);
29 preg_match('/^(.*)'.preg_quote($lsearch).'/Us',$lstr, $matches);
31 if ( count($matches) == 2 ) {
32 return substr($str, strlen($matches[1]));