From 49d54c0c3199fb8e380ce68f8fb08a308ddf56a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo?= Date: Mon, 25 Dec 2017 16:58:41 -0500 Subject: =?UTF-8?q?migraci=C3=B3n=20mayor=20a=20smarty=20PHP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smarty/plugins/modifier.replace.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 smarty/plugins/modifier.replace.php (limited to 'smarty/plugins/modifier.replace.php') diff --git a/smarty/plugins/modifier.replace.php b/smarty/plugins/modifier.replace.php new file mode 100644 index 0000000..aa5e857 --- /dev/null +++ b/smarty/plugins/modifier.replace.php @@ -0,0 +1,34 @@ + + * Name: replace
+ * Purpose: simple search/replace + * + * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) + * @author Monte Ohrt + * @author Uwe Tews + * + * @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) +{ + if (Smarty::$_MBSTRING) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + + return smarty_mb_str_replace($search, $replace, $string); + } + + return str_replace($search, $replace, $string); +} -- cgit v1.2.3