smarty template engine
Friday, May 16, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


strip_tags

This strips out markup tags, basically anything between < and >.

Parameter PositionTypeRequiredDefaultDescription
1boolNoTRUEThis determines whether the tags are replaced by ' ' or ''

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>."
               
);

?>

Where template is:

{$articleTitle}
{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
{$articleTitle|strip_tags:false}

Will output:

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.

See also replace and regex_replace.




 

credits 

Smarty Copyright © 2002-2008 New Digital Group, Inc.
All rights reserved.
Last updated: Tue Feb 12 09:11:24 2008 CST