summaryrefslogtreecommitdiff
path: root/smartyplugins/modifier.replace_limit.php
blob: 29c3a4982cbd4188c10c9900e1c33e8806f6dcc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
namespace Bitweaver\Plugins;

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * smarty_function_replace_limit
 */
function smarty_modifier_replace_limit( $pHaystack, $pNeedle, $pReplace, $pLimit  ) {
	return preg_replace('/'.str_replace('/', '\/', $pNeedle).'/', $pReplace, $pHaystack, $pLimit);
}