The strip_tags()
documentation tells us that all the tags except the that in the second parameter are stripped. The operation this function performs is totally opposite to its name. It should have been named strip_all_tags_except()
.
Let's forget about the name and come to what I want to ask. I want the functionality of removing only the tags I mention in the second parameter. ie. I want the following to strip tags <iframe><script><style><embed><object>
and allow all others.
my_strip_tags($data,'<iframe><script><style><embed><object>');
It's pretty opposite to what strip_tags()
does.
How do I make this happen?