I\'m importing some arbitrary HTML into a DOMDocument using the loadHTML() function, eg.:
DOMDocument
loadHTML()
$html = \'
Thanks but I won't necessarily know the type of the first tag in the body, it needs to be generic
$domnodelist = $doc->getElementsByTagName('*'); $domnode = $domnodelist->item(0); echo $doc->saveXML($domnode);