protected function getStyleCssMedia(array $tag_frag, $test_for_css = true)
    {
        if ($test_for_css && !$this->isStyleTagFragCss($tag_frag)) {
            return ''; // This tag does not contain CSS.
        }
        if (preg_match('/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui', $tag_frag['style_open_tag'], $_m)) {
            return trim(mb_strtolower($_m['value']));
        } // unset($_m); // Just a little housekeeping.

        return ''; // Unable to find a `media` attribute value.
    }
protected function getStyleCssMedia(array $tag_frag, $test_for_css = true)
    {
        if ($test_for_css && !$this->isStyleTagFragCss($tag_frag)) {
            return ''; // This tag does not contain CSS.
        }
        if (preg_match('/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui', $tag_frag['style_open_tag'], $_m)) {
            return trim(mb_strtolower($_m['value']));
        } // unset($_m); // Just a little housekeeping.

        return ''; // Unable to find a `media` attribute value.
    }
protected function getStyleCssMedia ( array $ tag_frag , $ test_for_css = true ) { if ( $ test_for_css && ! $ this -> isStyleTagFragCss ( $ tag_frag ) ) { return '' ; // This tag does not contain CSS. } if ( preg_match ( '/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui' , $ tag_frag [ 'style_open_tag' ] , $ _m ) ) { return trim ( mb_strtolower ( $ _m [ 'value' ] ) ) ; } // unset($_m); // Just a little housekeeping. return '' ; // Unable to find a `media` attribute value. }
Get a CSS style media rule from a tag fragment.

@since 140417 Initial release.

@param array $tag_frag     A CSS tag fragment.
@param bool  $test_for_css Defaults to a TRUE value.
If TRUE, we will test tag fragment to make sure it's CSS.

@return string The style media value if possible; else an empty string.
Get a CSS style media rule from a tag fragment .