Wanted to convert
<br/> <br/> <br/> <br/> <br/>
into
<br/>
You can do this with a regular expression:
preg_replace("/(<brs*/?>s*)+/", "<br/>", $input);
This if you pass in your source HTML, this will return a string with a single <br/> replacing every run of them.
1.4m articles
1.4m replys
5 comments
57.0k users