34 if (!$break_words && !$middle) {
46 if (isset($string[$length])) {
47 $length -= min($length, strlen($etc));
48 if (!$break_words && !$middle) {
49 $string = preg_replace(
'/\s+?(\S+)?$/',
'', substr($string, 0, $length + 1));
52 return substr($string, 0, $length) . $etc;
54 return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);
static $_UTF8_MODIFIER
Flag denoting if PCRE should run in UTF-8 mode.
static $_MBSTRING
Flag denoting if Multibyte String functions are available.
smarty_modifier_truncate($string, $length=80, $etc= '...', $break_words=false, $middle=false)
Smarty truncate modifier plugin.
static $_CHARSET
The character set to adhere to (e.g.