How to remove html tags from php
This article will explain in detail how php removes html tags. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
We may encounter this situation at work, where we need to filter a string, but this string has a html tag in it. So how should we deal with this situation?
1. PHP provides us with a function strip_tags ().
2. By using this function, we can easily filter strings with html tag codes.
Str = 'Hello, I'm so-and-so'; echo strip_tags ($str);? >
Input result: Hello, I am a certain person
Note: as you can see from the above code, the strip_tags () function sets the "
"the label was filtered out.
This is the end of this article on "how to remove html tags from php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.