33 $upper_string = preg_replace_callback(
"!(^|[^\p{L}'])([\p{Ll}])!S" .
Smarty::$_UTF8_MODIFIER, create_function (
'$matches',
'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[2]),MB_CASE_UPPER, "' . addslashes(
Smarty::$_CHARSET) .
'");'), $string);
37 if (preg_match_all(
"!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" .
Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
38 foreach($matches[1] as
$match) {
39 $upper_string = substr_replace($upper_string, mb_strtolower($match[0],
Smarty::$_CHARSET), $match[1], strlen($match[0]));
43 $upper_string = preg_replace_callback(
"!((^|\s)['\"])(\w)!" .
Smarty::$_UTF8_MODIFIER, create_function (
'$matches',
'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, "' . addslashes(
Smarty::$_CHARSET) .
'");'), $upper_string);
49 $string = strtolower($string);
52 $upper_string = preg_replace_callback(
"!(^|[^\p{L}'])([\p{Ll}])!S" .
Smarty::$_UTF8_MODIFIER, create_function (
'$matches',
'return stripslashes($matches[1]).ucfirst(stripslashes($matches[2]));'), $string);
55 if (preg_match_all(
"!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" .
Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
56 foreach($matches[1] as
$match) {
57 $upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0]));
61 $upper_string = preg_replace_callback(
"!((^|\s)['\"])(\w)!" .
Smarty::$_UTF8_MODIFIER, create_function (
'$matches',
'return stripslashes($matches[1]).ucfirst(stripslashes($matches[3]));'), $upper_string);
static $_UTF8_MODIFIER
Flag denoting if PCRE should run in UTF-8 mode.
static $_MBSTRING
Flag denoting if Multibyte String functions are available.
static $_CHARSET
The character set to adhere to (e.g.
smarty_modifier_capitalize($string, $uc_digits=false, $lc_rest=false)
Smarty capitalize modifier plugin.