Smarty:strip_tags

2018-10-12 15:45 更新

strip_tags

去除標記等任何包含在< 和 >中間的字符。.

參數(shù)順序類型必選參數(shù)默認值說明
1boolNoTRUE設(shè)置是否將標簽替換成' ' 或者 ''

Example 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} {* same as {$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.


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號