How to remove multiple <br> tags from a RSS feed? I tried those two but it doesn’t make any change.
str_replace("<br/><br/>","&",$entry->description);
str_replace("<br><br>","&",$entry->description);
str_replace("<br/><br/>","&",$entry->description);
str_replace("<br /><br />","&",$entry->description); (with space)
Here is a sample
This is copied from feedburn RSS<br /><br />with view page source.
Open it in a DOM Parser and look for
brelements of whom theirnextSibling(orpreviousSiblingif iterating in reverse) is anotherbrelement (you could repeat this for multiplebrelements that are direct siblings). Then remove them.CodePad.
I chose to iterate in reverse to save another variable used for the incremental number.
I had to use a
while() { ... }with an index because aforeach()would hold a reference to nodes I would be removing, which would result in errors.