手册上这样写: This function tries to return a string with all HTML and PHP tags stripped from a given str . It uses the same tag stripping state machine as the fgetss() function. 例子:$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>'; echo strip_tags($text); echo "\n"; // Allow <p> and <a> echo strip_tags($text, '<p><a>');输出: Test paragraph. Other text <p>Test paragraph.</p> <a href="#fragment">Other text</a>没有提到你说的功能啊? 你写的那句功能是保留串中的img标签吧。
This function tries to return a string with all HTML and PHP tags stripped from a given str . It uses the same tag stripping state machine as the fgetss() function.
例子:$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// Allow <p> and <a>
echo strip_tags($text, '<p><a>');输出:
Test paragraph. Other text
<p>Test paragraph.</p> <a href="#fragment">Other text</a>没有提到你说的功能啊?
你写的那句功能是保留串中的img标签吧。