smarty中可以使用strip_tags去除html标签,包括在< >之间的任何内容。
例如:
index.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', "Blind Woman Gets <font face=\"helvetica\">New Kidney</font> from Dad she Hasn't Seen in <b>years</b>.");
$smarty->display('index.tpl');
index.tpl:
{$articleTitle}
{$articleTitle|strip_tags}
输出结果:
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.









最新评论
再来浏览一次,上次没看懂。
:evil: 不错啊
博主的技术文章很有帮助
好文章,关注啦!谢谢博主分享
你好 来学习下
我来了哦
第一次来访留个记号
呵呵,哥们越来越勤奋了啊 :
php点点通,(www.ph
:eek: :eek: