Is there a way to keep entities intact while parsing html with DomDocument?

后端 未结 3 1008
孤街浪徒
孤街浪徒 2020-12-10 06:56

I have this function to ensure every img tag has absolute URL:

function absoluteSrc($html, $encoding = \'utf-8\')
{
    $dom = new DOMDocume         


        
3条回答
  •  半阙折子戏
    2020-12-10 07:36

    I'd like to know the answer to this as well.

    I ended up converting &..; entities to **ENTITY-...-ENTITY** before parsing and converting back after it is done.

提交回复
热议问题