How to remove redundant
tags from HTML code using PHP?

前端 未结 5 1592
孤街浪徒
孤街浪徒 2021-01-14 00:52

I\'m parsing some messy HTML code with PHP in which there are some redundant
tags and I would like to clean them up a bit. For instance:


&
5条回答
  •  一生所求
    2021-01-14 01:02

    this will replace all breaks ... even if they're in uppercase:

    preg_replace('/]*>/i', '', $string);
    

提交回复
热议问题