PHP を使用して HTML をエンティティに変換しようとしていますが、 <br> および <a> タグを除外する必要があります。
ここに私のコードの例があります
 <?php 
  $string[0] = "<a href='http://hidd3n.tk'>Needs to stay</a> Filler text in between 
 <br><br> <script src='http://malicious.com/'></script> NEEDS to go";
  $string[1] = htmlentities($string[0], ENT_QUOTES, "UTF-8");
 ?>