I am having problems using the PHP strip_tags function when a string contains less and more characters. For example:
If I do this:
strip_tags("<span>some text <5ml and then >10ml some text </span>");
I will get:
some text 10ml some text
But obviously I want to get:
some text <5ml and then >10ml some text
Yes, I know I can use & lt; and & gt; but I donβt have the ability to convert these characters to HTML objects, since the data is already saved, as you can see in my example.
What I'm looking for is a smart way to parse HTML to get rid of real HTML tags only.
Since TinyMCE was used to generate this data, I know what actual html tags can be used anyway, so implementing strip_tags($string, $black_list) would be more useful than strip_tags($string, $allowable_tags) .
Anyone though?
texai
source share