The Strip_tags () function strips HTML, XML, and PHP tags.
Copy the Code code as follows:
World! ");? >
In Smarty, you can use Strip_tags to remove HTML tags, including any content between < >.
For example:
index.php:
Copy the Code code as follows:
$smarty = new Smarty;
$smarty->assign (' ArticleTitle ', "Blind Woman Gets New kidney from the Dad she hasn ' t Seen in years.");
$smarty->display (' Index.tpl ');
INDEX.TPL:
Copy the Code code as follows:
{$articleTitle}
{$articleTitle |strip_tags}
Output Result:
Copy the Code code as follows:
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.
Article interception:
Copy the Code code as follows:
{$article. content|truncate:35: "...": true}
The above describes the Smarty in the first strip_tags filtering HTML tags after the truncate interception of the article, including the content, I hope that the PHP tutorial interested in a friend helpful.