I am trying to take an entire site into a DOM object like this:
$dom = new DOMDocument('1.0');
$dom->loadHTMLFile('http://thissite.com');
so that I can manipulate it and save a template.
However, some objects ( tags I have noticed) are stripping custom attributes out, so that:
<a href="/link/to/page/" aria-haspopup="true">Link Name</a>
changes to:
<a href="/link/to/page/">Link Name</a>
Is there any way to stop this happening?
UPDATE: Looks like this was not the issue, will leave an answer below to explain and potentially help others.