php DomDocument adds extra tags

后端 未结 5 708
伪装坚强ぢ
伪装坚强ぢ 2020-12-19 03:09

I\'m trying to parse a document and get all the image tags and change the source for something different.


    $domDocument = new DOMDocument();

    $domDo         


        
5条回答
  •  青春惊慌失措
    2020-12-19 04:00

    DomDocument is unfortunately retarded and won't let you do this. Try this:

    $text = preg_replace('/^/', '', str_replace( array('', '', '', ''), array('', '', '', ''), $domDocument->saveHTML()));
    

提交回复
热议问题