I am trying to remove specific HTML tags from from text. I am currently working with the str_ireplace but it is starting to get cumbersome because there are so many ways to write the same tag. This is what I have nowand that is only two of the tags I want to remove. By the time I am done this line will be a mile long.PHP Code:$search=array('<p>','</p>','</ p>','<p/>','<p />','<br>','</br>','</ br>','<br/>','<br />');
$replace=array('','','','','','','','','','');
I tried reading the pattern rules to preg_replace but something unexpected happened, my head detached from my neck and hit the floor.
There must be a simpler way. (using a case-insensitive function is a bonus)





Reply With Quote