Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F1125583
modifiercompiler.count_characters.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
944 B
Subscribers
None
modifiercompiler.count_characters.php
View Options
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_characters modifier plugin
*
* Type: modifier<br>
* Name: count_characteres<br>
* Purpose: count the number of characters in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function
smarty_modifiercompiler_count_characters
(
$params
,
$compiler
)
{
if
(!
isset
(
$params
[
1
])
||
$params
[
1
]
!=
'true'
)
{
return
'preg_match_all(
\'
/[^
\s
]/'
.
Smarty
::
$_UTF8_MODIFIER
.
'
\'
,'
.
$params
[
0
]
.
', $tmp)'
;
}
if
(
Smarty
::
$_MBSTRING
)
{
return
'mb_strlen('
.
$params
[
0
]
.
',
\'
'
.
addslashes
(
Smarty
::
$_CHARSET
)
.
'
\'
)'
;
}
// no MBString fallback
return
'strlen('
.
$params
[
0
]
.
')'
;
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jun 18 2025, 04:58 (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25809
Default Alt Text
modifiercompiler.count_characters.php (944 B)
Attached To
rZED Zed
Event Timeline
Log In to Comment