當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utf8::str_ireplace方法代碼示例

本文整理匯總了PHP中Patchwork\Utf8::str_ireplace方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utf8::str_ireplace方法的具體用法?PHP Utf8::str_ireplace怎麽用?PHP Utf8::str_ireplace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Patchwork\Utf8的用法示例。


在下文中一共展示了Utf8::str_ireplace方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_replace_linefeed_search

 public function test_replace_linefeed_search()
 {
     $str = "Iñtërnâtiônàli\nzætiøn";
     $replaced = "Iñtërnâtiônàlisetiøn";
     $this->assertEquals($replaced, u::str_ireplace("lI\nzÆ", 'lise', $str));
 }
開發者ID:nicolas-grekas,項目名稱:Patchwork-sandbox,代碼行數:6,代碼來源:Utf8StrIreplaceTest.php

示例2: api_str_ireplace

/**
 * This function returns a string or an array with all occurrences of search in subject (ignoring case) replaced with the given replace value.
 * @param mixed $search					String or array of strings to be found.
 * @param mixed $replace				String or array of strings used for replacement.
 * @param mixed $subject				String or array of strings being searched.
 * @param int $count (optional)			The number of matched and replaced needles will be returned in count, which is passed by reference.
 * @param string $encoding (optional)	The used internally by this function character encoding.
 * If it is omitted, the platform character set will be used by default.
 * @return mixed						String or array as a result.
 * Notes:
 * If $subject is an array, then the search and replace is performed with every entry of subject, the return value is an array.
 * If $search and $replace are arrays, then the function takes a value from each array and uses it to do search and replace on subject.
 * If $replace has fewer values than search, then an empty string is used for the rest of replacement values.
 * If $search is an array and $replace is a string, then this replacement string is used for every value of search.
 * This function is aimed at replacing the function str_ireplace() for human-language strings.
 * @link http://php.net/manual/en/function.str-ireplace
 * @author Henri Sivonen, mailto:hsivonen@iki.fi
 * @link http://hsivonen.iki.fi/php-utf8/
 * Adaptation for Chamilo 1.8.7, 2010
 * Initial implementation Dokeos LMS, August 2009
 * @author Ivan Tcholakov
 */
function api_str_ireplace($search, $replace, $subject, &$count = null, $encoding = null)
{
    return Utf8::str_ireplace($search, $replace, $subject, $count);
}
開發者ID:KRCM13,項目名稱:chamilo-lms,代碼行數:26,代碼來源:internationalization.lib.php


注:本文中的Patchwork\Utf8::str_ireplace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。