Files
smarty/plugins/modifier.replace.php

31 lines
759 B
PHP
Raw Normal View History

<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
/**
* Smarty replace modifier plugin
2017-11-11 07:11:33 +01:00
* Type: modifier
* Name: replace
* Purpose: simple search/replace
*
* @link https://www.smarty.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
*
2011-09-16 14:19:56 +00:00
* @param string $string input string
* @param string $search text to search for
* @param string $replace replacement text
*
* @return string
*/
function smarty_modifier_replace($string, $search, $replace)
{
2022-11-30 00:25:27 +01:00
if (\Smarty\Smarty::$_MBSTRING) {
return smarty_mb_str_replace($search, $replace, $string);
}
return str_replace($search, $replace, $string);
}