Alright. So I'm using DOMDocument to read html files. One thing I've noticed is that when I do this
$doc = new DOMDocument();
$doc->loadHTML($htmlstring);
$doc->saveHTML();
it will add on a doctype header, and html and body tags.
I've gotten around this by doing this
$doc = new DOMDocument();
$doc->loadXML($htmlstring,LIBXML_NOXMLDECL);
$doc->saveXML();
The problem with this however is the fact that now all my tags are case sensitive, and it gets mad if I have more than one document root.
Is there an alternative so that I can load up partial html files, grab tags and such, replace them, and get the string without having to parse the files manually?
Basically I want the functionallity of DOMDocument->loadHTML
, without the added tags and header.
Any ideas?