5 * @subpackage plugins
\r
10 * Smarty count_characters modifier plugin
\r
12 * Type: modifier<br>
\r
13 * Name: count_characteres<br>
\r
14 * Purpose: count the number of characters in a text
\r
15 * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
\r
16 * count_characters (Smarty online manual)
\r
18 * @param boolean include whitespace in the character count
\r
21 function smarty_modifier_count_characters($string, $include_spaces = false)
\r
23 if ($include_spaces)
\r
24 return(strlen($string));
\r
26 return preg_match_all("/[^\s]/",$string, $match);
\r
29 /* vim: set expandtab: */
\r