The Strip_tags () function strips HTML, XML, and PHP tags.
Copy Code code as follows:
<?php Echo strip_tags ("Hello <b>world!</b>");?>
Smarty can be used strip_tags to remove HTML tags, including any content between < >.
For example:
index.php:
Copy Code code as follows:
$smarty = new Smarty;
$smarty->assign (' ArticleTitle ', "Blind Woman Gets <span style=" font-family: & ">new kidney</span> From Dad she hasn ' t seen in <strong>years</strong>. ");
$smarty->display (' Index.tpl ');
INDEX.TPL:
Copy Code code as follows:
{$articleTitle}
{$articleTitlestrip _tags}
Output results:
Copy Code code as follows:
Blind Woman Gets <span style= "Font-family:helvetica;" >new kidney</span> from Dad She hasn ' t seen in <strong>years</strong>.
Blind Woman Gets the New kidney from Dad The she hasn ' t seen in years.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service