As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
开发者_Python百科
Closed 10 years ago.
I want to remove all tags except the img tag,
$words = strip_tags($words, '<img>');
Is it useful?
Yes, to remove tags.
But strip_tags() won't help against the most dangerous thing - an XSS. You will need some regular expression, or use http://htmlpurifier.org/ to be sure there are no unwanted parameters in the <img> tag.
精彩评论