XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
modifier.capitalize.php
Go to the documentation of this file.
1
<?php
21
function
smarty_modifier_capitalize
($string, $uc_digits =
false
)
22
{
23
smarty_modifier_capitalize_ucfirst
(null, $uc_digits);
24
return
preg_replace_callback(
'!\'?\b\w(\w|\')*\b!'
,
'smarty_modifier_capitalize_ucfirst'
, $string);
25
}
26
27
function
smarty_modifier_capitalize_ucfirst
($string, $uc_digits = null)
28
{
29
static
$_uc_digits =
false
;
30
31
if
(isset($uc_digits)) {
32
$_uc_digits = $uc_digits;
33
return
;
34
}
35
36
if
(substr($string[0],0,1) !=
"'"
&& !preg_match(
"!\d!"
,$string[0]) || $_uc_digits)
37
return
ucfirst($string[0]);
38
else
39
return
$string[0];
40
}
41
42
43
?>
L:
0xoops
xoops-2.5.6
htdocs
class
smarty
plugins
modifier.capitalize.php
Generated on Fri May 10 2013 01:04:24 for XOOPS 2.5.6 by
1.8.3.1