strip_tags

    去除标记内容,亦即<>之间的所有内容。

参数位置 类型 必需? 缺省 描述
1boolNoTRUE 确定标记内容由' '还是''代替

例子5-20. strip_tags

<?php

$smarty
->assign('articleTitle',
                
"Blind Woman Gets <font face=\"helvetica\">New
Kidney</font> from Dad she Hasn't Seen in <b>years</b>."
               
);

?>

    模板为:

{$articleTitle}
{$articleTitle|strip_tags} {* 等于{$articleTitle|strip_tags:true} *}
{$articleTitle|strip_tags:false}

    输出为:

Blind Woman Gets <font face="helvetica">New Kidney</font> from Dad she Hasn't Seen in <b>years</b>.
Blind Woman Gets  New Kidney  from Dad she Hasn't Seen in  years .
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.

    参见replace以及regex_replace