I would like to remove all HTML tags from a string with the exception of leaving the first occurrence of an tag only.
I have been playing around with the PHP strip_tags() function but have had limited success with this. I also have done an extensive amount of research to find some existing code with no success.
Does anyone have any suggestions on how this could be accomplished? I would prefer to do with with PHP and possibly the strip_tags() function.
All help is appreciated. Thanks.
I did figure it out with something like this for a WordPress post...
Please note in the strip_tags() function you will need a second parameter to show which HTML tags not to remove from the string.