1 2 3 4 5
<?php $str = "<br><br > <br><br>Test<br ><br>"; echo preg_replace("/(\s*<br\s*>)+/", "<br>", $str);
1
<br>Test<br>