We can remove all html tags from the content by using strip_tags string function in PHP. This function can be used to collect only the content part without reading the html formatting of the page. Here is the syntax
This function also allows one optional string where we can keep the tags which are not to be removed. Say we don't want the hyper links to be removed. So we will allow the linking tag <a href to be kept as it is. Here is the syntax for this.
In the above code $string_str is the input string.