strip_tags
パラメータの位置 | 型? | 必須 | デフォルト | 概要 |
---|---|---|---|---|
1 | bool? | No | true | タグを' 'または''のどちらで置き換えるか |
基本的に、< と > によって囲まれたマークアップタグを取り除きます。
例 5-19. strip_tags
<?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} {* 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.
2005年07月08日(金) 11:14:10 Modified by smarten