$dom = new DOMDocument();
// this may raise parse errors as some html may be a component..
- @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
+ @$dom->loadHTML($html);
$links = $dom->getElementsByTagName('link');
$lc = array();
foreach ($links as $link) { // duplicate as links is dynamic and we change it..!
function htmlbodyInlineCss($html)
{
+ print_R($html);exit;
$dom = new DOMDocument();
@$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
if(!$head->length){
$head = $dom->createElement('head');
- $html->item(0)->insertBefore($head, $html->item(0));
+ $html->item(0)->insertBefore($head, $body->item(0));
$head = $dom->getElementsByTagName('head');
}