用strip_tags吧 This function tries to return a string with all HTML and PHP tags stripped from a given str. 调用格式:strip_tags('字符串','保留的html的标记')例子: $text = '您的文章<a>a</a><div>div</div><font>font</font><body>body</body>'; $text = strip_tags($text, '<a><font>'); echo $text;
This function tries to return a string with all HTML and PHP tags stripped from a given str.
调用格式:strip_tags('字符串','保留的html的标记')例子:
$text = '您的文章<a>a</a><div>div</div><font>font</font><body>body</body>';
$text = strip_tags($text, '<a><font>');
echo $text;