As an example, my page html contains <?php echo $frm['elements']['product_id_page-0-0']['htmle'] ?> from a third-party membership app. The code adds br tags which I don't want.
By using <?php echo str_replace('<br />', '', $frm['elements']['product_id_page-0-0']['htmle']) ?>, those br tags are removed without the need to modify the core code.
There are several instances of similar code in a page, and I add the str_replace to each.
When I originally posted my question, I'd mistakenly thought that I could add one str_replace to the whole page and have all br tags removed. I now realise that str_replace has to be added to each element to be modified.