php使用strip_tags过滤所有html标签,并保留特定HTML标签的方法

Posted by he; tagged with php , html标签 , 过滤

过滤所有html标签:

strip_tags($str);

保留特定HTML标签(此处保留 <p>、 <b>,其他html标签全部清除):

strip_tags($str, "<p> <b>");
- 本文完 -