| Server IP : 180.180.241.3 / Your IP : 216.73.216.25 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/libraries/phputf8/ |
Upload File : |
<?php
/**
* @version $Id: stristr.php 10381 2008-06-01 03:35:53Z pasamio $
* @package utf8
* @subpackage strings
*/
//---------------------------------------------------------------
/**
* UTF-8 aware alternative to stristr
* Find first occurrence of a string using case insensitive comparison
* Note: requires utf8_strtolower
* @param string
* @param string
* @return int
* @see http://www.php.net/strcasecmp
* @see utf8_strtolower
* @package utf8
* @subpackage strings
*/
function utf8_stristr($str, $search) {
if ( strlen($search) == 0 ) {
return $str;
}
$lstr = utf8_strtolower($str);
$lsearch = utf8_strtolower($search);
preg_match('|^(.*)'.preg_quote($lsearch).'|Us',$lstr, $matches);
if ( count($matches) == 2 ) {
return substr($str, strlen($matches[1]));
}
return FALSE;
}