-
Notifications
You must be signed in to change notification settings - Fork 35
strip_tags
Umakant Patil edited this page Aug 14, 2017
·
1 revision
Strips out markup tags, basically anything between < and >.
Parameter Position | Type | Required | Default | Description |
---|---|---|---|---|
1 | bool | No | true | This determines whether the tags are replaced by ' ' or '' |
2 | string | No | n/a | If any tag is to be excluded from stripping. |
Template:
{$articleTitle = 'Blind Woman Gets <font face="helvetica">NewKidney</font> from <i>Dad</i> she Hasn\'t Seen in <b>years</b>.'}
{$articleTitle}
{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
{$articleTitle|strip_tags:false}
{$articleTitle|strip_tags:false:'<i><b>'} {*Keep i and b tag and remove other tags.*}
output:
Blind Woman Gets <font face="helvetica">New Kidney</font> from <i>Dad</i> 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.
Blind Woman Gets New Kidney from <i>Dad</i> she Hasn't Seen in <b>years</b>.
see also strip_tags in PHP Smarty documentation.