当前位置: 首页>>代码示例>>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;未经允许,请勿转载。