public function getHead()
    {
        $head = $this->dom->getElementsByTagName('head');
        if ($head->length) {
            return $head->item(0);
        }

        $headelt = $this->dom->createElement('head');
        $this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);

        return $headelt;
    }
public function getHead()
    {
        $head = $this->dom->getElementsByTagName('head');
        if ($head->length) {
            return $head->item(0);
        }

        $headelt = $this->dom->createElement('head');
        $this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);

        return $headelt;
    }
public function getHead ( ) { $ head = $ this -> dom -> getElementsByTagName ( 'head' ) ; if ( $ head -> length ) { return $ head -> item ( 0 ) ; } $ headelt = $ this -> dom -> createElement ( 'head' ) ; $ this -> dom -> documentElement -> insertBefore ( $ headelt , $ this -> dom -> documentElement -> firstChild ) ; return $ headelt ; }
Returns the HEAD element, or creates one if it doesn't exist.

@return DOMElement  HEAD element.
Returns the HEAD element or creates one if it doesn t exist .