strip_tags

パラメータの位置?必須デフォルト概要
1bool?Notrueタグを' 'または''のどちらで置き換えるか

基本的に、< と > によって囲まれたマークアップタグを取り除きます。


例 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




スマートフォン版で見る