function smarty_outputfilter_trimwhitespace_replace in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/lib/smarty/plugins/outputfilter.trimwhitespace.php \smarty_outputfilter_trimwhitespace_replace()
1 call to smarty_outputfilter_trimwhitespace_replace()
- smarty_outputfilter_trimwhitespace in includes/
moodle/ lib/ smarty/ plugins/ outputfilter.trimwhitespace.php - Smarty trimwhitespace outputfilter plugin
File
- includes/
moodle/ lib/ smarty/ plugins/ outputfilter.trimwhitespace.php, line 64
Code
function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
$_len = strlen($search_str);
$_pos = 0;
for ($_i = 0, $_count = count($replace); $_i < $_count; $_i++) {
if (($_pos = strpos($subject, $search_str, $_pos)) !== false) {
$subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
}
else {
break;
}
}
}