protected function getHeadFrag($html)
    {
        if (!($html = (string) $html)) {
            return []; // Nothing to do.
        }
        if (preg_match('/(?P<all>(?P<open_tag>\<head(?:\s+[^>]*?)?\>)(?P<contents>.*?)(?P<closing_tag>\<\/head\>))/uis', $html, $head_frag)) {
            return $this->removeNumericKeysDeep($head_frag);
        }
        return [];
    }
protected function getHeadFrag($html)
    {
        if (!($html = (string) $html)) {
            return []; // Nothing to do.
        }
        if (preg_match('/(?P<all>(?P<open_tag>\<head(?:\s+[^>]*?)?\>)(?P<contents>.*?)(?P<closing_tag>\<\/head\>))/uis', $html, $head_frag)) {
            return $this->removeNumericKeysDeep($head_frag);
        }
        return [];
    }
protected function getHeadFrag ( $ html ) { if ( ! ( $ html = ( string ) $ html ) ) { return [ ] ; // Nothing to do. } if ( preg_match ( '/(?P<all>(?P<open_tag>\<head(?:\s+[^>]*?)?\>)(?P<contents>.*?)(?P<closing_tag>\<\/head\>))/uis' , $ html , $ head_frag ) ) { return $ this -> removeNumericKeysDeep ( $ head_frag ) ; } return [ ] ; }
Build a head fragment from HTML source code.

@since 140417 Initial release.

@param string $html Raw HTML code.

@return array A head fragment (if possible); else an empty array.
Build a head fragment from HTML source code .