本文整理匯總了PHP中utf8_stristr函數的典型用法代碼示例。如果您正苦於以下問題:PHP utf8_stristr函數的具體用法?PHP utf8_stristr怎麽用?PHP utf8_stristr使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了utf8_stristr函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stristr
/**
* UTF-8 aware alternative to stristr()
*
* Returns all of haystack from the first occurrence of needle to the end. Needle and haystack are examined in a case-insensitive manner to
* find the first occurrence of a string using case insensitive comparison.
*
* @param string $str The haystack
* @param string $search The needle
*
* @return string the sub string
*
* @see http://www.php.net/stristr
* @since 1.3.0
*/
public static function stristr($str, $search)
{
return utf8_stristr($str, $search);
}
示例2: stristr
/**
* UTF-8 aware alternative to stristr
* Returns all of haystack from the first occurrence of needle to the end.
* needle and haystack are examined in a case-insensitive manner
* Find first occurrence of a string using case insensitive comparison
*
* @param string $str The haystack
* @param string $search The needle
*
* @return string the sub string
*
* @see http://www.php.net/stristr
* @since 11.1
*/
public static function stristr($str, $search)
{
jimport('phputf8.stristr');
return utf8_stristr($str, $search);
}
示例3: testLinefeedBoth
function testLinefeedBoth()
{
$str = "iñtërn\nâtiônàlizætiøn";
$search = "N\nÂT";
$this->assertEqual(utf8_stristr($str, $search), "n\nâtiônàlizætiøn");
}
示例4: stristr
/**
* UTF-8 aware alternative to stristr
* Returns all of haystack from the first occurrence of needle to the end.
* needle and haystack are examined in a case-insensitive manner
* Find first occurrence of a string using case insensitive comparison
*
* @param string $str The haystack
* @param string $search The needle
*
* @return string the sub string
*
* @see http://www.php.net/stristr
* @since 2.0
*/
public static function stristr($str, $search)
{
if (!function_exists('utf8_stristr')) {
require_once __DIR__ . '/phputf8/stristr.php';
}
return utf8_stristr($str, $search);
}
示例5: stristr
/**
* UTF-8 aware alternative to stristr
* Returns all of haystack from the first occurrence of needle to the end.
* needle and haystack are examined in a case-insensitive manner
* Find first occurrence of a string using case insensitive comparison
*
* @param string $str The haystack
* @param string $search The needle
*
* @return string the sub string
*
* @see http://www.php.net/stristr
* @since 1.0
*/
public static function stristr($str, $search)
{
require_once __DIR__ . '/phputf8/stristr.php';
return utf8_stristr($str, $search);
}