strip_tags() 函数剥去 HTML、XML 以及 PHP 的标签。 <?php echo strip_tags(“Hello <b>world!</b>”); ?> smarty中可以使用strip_tags去除html标签,包括在< >...
首先进入到smarty包下的plugins,复制一份modifier.truncate.php,并重命名为modifier.truncate_cn.php,把其中的smarty_modifier_truncate函数替换为下面代码: fun...
capitalize This is used to capitalize the first letter of all words in a variable. 将变量里的所有单词首字大写。 count_characters[字符计数] index.php: ...
Smarty 中的 if 语句和 php 中的 if 语句一样灵活易用,并增加了几个特性以适宜模板引擎. if 必须于 /if 成对出现. 可以使用 else 和 elseif 子句.