X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Fmodifier.count_characters.php;fp=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Fmodifier.count_characters.php;h=49ce655e85354a7a121bcad6380167ed49fd9da5;hb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;hp=0000000000000000000000000000000000000000;hpb=dcee763368a1e3f380d07320a5254d91a09304e6;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/smarty/node_methodz/modifier.count_characters.php b/wwwroot/inc/smarty/node_methodz/modifier.count_characters.php new file mode 100644 index 0000000..49ce655 --- /dev/null +++ b/wwwroot/inc/smarty/node_methodz/modifier.count_characters.php @@ -0,0 +1,31 @@ + + * Name: count_characteres
+ * Purpose: count the number of characters in a text + * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php + * count_characters (Smarty online manual) + * @param string + * @param boolean include whitespace in the character count + * @return integer + */ +function smarty_modifier_count_characters($string, $include_spaces = false) +{ + if ($include_spaces) + return(strlen($string)); + + return preg_match_all("/[^\s]/",$string, $match); +} + +/* vim: set expandtab: */ + +?>