Do not convert
<br/>
<br/><br/>
Convert, if there are more than two newline tag
<br/><br/><br/>
into
<br/><br/>
How to add my condition to this?
preg_replace("/(<br\s*\/?>\s*)+/", "<br/><br/>", $input);
Do not convert
<br/>
<br/><br/>
Convert, if there are more than two newline tag
<br/><br/><br/>
into
<br/><br/>
How to add my condition to this?
preg_replace("/(<br\s*\/?>\s*)+/", "<br/><br/>", $input);
(<br[ ]*\/?>){2,}
Simply use this.And replace it by <br/><br/>
.