Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
strip_tags() 能够允许未剥离的标签。
看下面的例子
<?php $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>'; // Allow <p> and <a> echo strip_tags($text, '<p><a>'); ?>
或手册 http://www.php.net/manual/en/function.strip-tags.php