I am trying to sanitize a string with HTML code. The string could contain multiple HTML tags.
I want to sanitize all of the elements in the string, except for <br>
and <font>
tags.
By sanitizing, I want to replace them with their entities, so that the tags don't load.
I have tried to use other code supplied, but it didn't seem to work, and I couldn't figure out how to modify it to not sanitize both of the elements.
For example, when I have a string with HTML elements in it, I want to remove all the tags except for and ones.