In smarty, use strip_tags to filter html tags and truncate to intercept articles. The strip_tags () function removes tags from HTML, XML, and PHP. Copy the code as follows :? Phpechostrip_tags ("Hellobworld! B ");? In smarty, you can use the strip_tags function to remove tags of html, XML, and PHP.
The code is as follows:
World!");?>
In smarty, you can use strip_tags to remove html tags, including any content between <>.
For example:
Index. php:
The code is as follows:
$ Smarty = new Smarty;
$ Smarty-> assign ('articletitle', "Blind Woman Gets New Kidney from Dad she hasn' t Seen inYears.");
$ Smarty-> display ('index. tpl ');
Index. tpl:
The code is as follows:
{$ ArticleTitle}
{$ ArticleTitle | strip_tags}
Output result:
The code is as follows:
Blind Woman Gets New Kidney from Dad she Hasn't Seen inYears.
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
Article interception:
The code is as follows:
{$ Article. content | truncate: 35 :"..." : True}
The http://www.bkjia.com/PHPjc/322495.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/322495.htmlTechArticlestrip_tags () function removes HTML, XML, and PHP labels. The code is as follows :? Php echo strip_tags ("Hello bworld! /B ");? In smarty, you can use strip_tags to remove html tags...