本文整理汇总了PHP中OC_Helper::mb_str_replace方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Helper::mb_str_replace方法的具体用法?PHP OC_Helper::mb_str_replace怎么用?PHP OC_Helper::mb_str_replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Helper
的用法示例。
在下文中一共展示了OC_Helper::mb_str_replace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mb_str_replace
/**
* Replace all occurrences of the search string with the replacement string
*
* @param string $search The value being searched for, otherwise known as the needle. String.
* @param string $replace The replacement string.
* @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
* @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
* @param int $count If passed, this will be set to the number of replacements performed.
* @return string
* @since 4.5.0
* @deprecated 8.2.0 Use str_replace() instead.
*/
public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null)
{
return \OC_Helper::mb_str_replace($search, $replace, $subject, $encoding, $count);
}
示例2: testMb_str_replace
function testMb_str_replace()
{
$result = OC_Helper::mb_str_replace("teststring", "string", "This is a teststring");
$expected = "This is a string";
$this->assertEquals($result, $expected);
}