private static function getCleanedHTML(DOMDocument $doc, $container)
    {
        while ($doc->firstChild) {
            $doc->removeChild($doc->firstChild);
        }

        while ($container->firstChild ) {
            $doc->appendChild($container->firstChild);
        }

        $html = trim($doc->saveHTML());
        return $html;
    }
private static function getCleanedHTML(DOMDocument $doc, $container)
    {
        while ($doc->firstChild) {
            $doc->removeChild($doc->firstChild);
        }

        while ($container->firstChild ) {
            $doc->appendChild($container->firstChild);
        }

        $html = trim($doc->saveHTML());
        return $html;
    }
private static function getCleanedHTML ( DOMDocument $ doc , $ container ) { while ( $ doc -> firstChild ) { $ doc -> removeChild ( $ doc -> firstChild ) ; } while ( $ container -> firstChild ) { $ doc -> appendChild ( $ container -> firstChild ) ; } $ html = trim ( $ doc -> saveHTML ( ) ) ; return $ html ; }
Clean extra code

@param DOMDocument $doc
@param $container
@return string
Clean extra code