I recently discovered the strip_tags() function which takes a string and a list of accepted html tags as parameters.
Lets say I wanted to get rid of images in a string here is an example:
$html = '
'; $html = 'This should be bold
'; $html .= 'This is awesome
'; $html .= 'This should be bold'; echo strip_tags($html,"");
returns this:
This should be bold
This is awesome
This should be bold consequently I gotten rid of my formatting via and perhaps in the future.
I want a way to blacklist rather than whitelist something like:
echo blacklist_tags($html,"
"); returning:
This should be bold
This is awesome
This should be bold Is there any way to do this?
'; $html = '