source: trunk/include/smarty/libs/plugins/modifier.replace.php @ 23384

Last change on this file since 23384 was 23384, checked in by rvelices, 11 years ago

smarty 3 - first pass for tests

  • Property svn:eol-style set to LF
File size: 834 bytes
Line 
1<?php
2/**
3 * Smarty plugin
4 * @package Smarty
5 * @subpackage PluginsModifier
6 */
7
8/**
9 * Smarty replace modifier plugin
10 *
11 * Type:     modifier<br>
12 * Name:     replace<br>
13 * Purpose:  simple search/replace
14 *
15 * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
16 * @author Monte Ohrt <monte at ohrt dot com>
17 * @author Uwe Tews
18 * @param string $string  input string
19 * @param string $search  text to search for
20 * @param string $replace replacement text
21 * @return string
22 */
23function smarty_modifier_replace($string, $search, $replace)
24{
25    if (Smarty::$_MBSTRING) {
26        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
27        return smarty_mb_str_replace($search, $replace, $string);
28    }
29   
30    return str_replace($search, $replace, $string);
31} 
32
33?>
Note: See TracBrowser for help on using the repository browser.