例如:
StackOverflow<br>
<br>
<br>
<br>
<br>
is
<br>
<br>
<br>
<br>
a
<br>
community.
至:
StackOverflow
<br>
<br>
is
<br>
<br>
a
<br>
community.
如果一个字符串中超过 2<br>
个,它应该删除所有的<br>
并只保留两个。到目前为止的代码:
$txt_unclean = trim(nl2br($_POST['txt_content']));
$txt_content = strip_tags($txt_unclean, '<br>');
你下一步怎么做?我如何允许不超过 2 <br>
。