src/Sulu/Bundle/MarkupBundle/Markup/HtmlTagExtractor.php
private function getAttributes($tag)
    {
        if (!preg_match_all(self::ATTRIBUTE_REGEX, $tag, $matches)) {
            return [];
        }

        $attributes = [];
        for ($i = 0, $length = count($matches['name']); $i < $length; ++$i) {
            $value = $matches['value'][$i];

            if ('true' === $value || 'false' === $value) {
                $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
            }

            $attributes[$matches['name'][$i]] = $value;
        }

        return $attributes;
    }
private function getAttributes($tag)
    {
        if (!preg_match_all(self::ATTRIBUTE_REGEX, $tag, $matches)) {
            return [];
        }

        $attributes = [];
        for ($i = 0, $length = count($matches['name']); $i < $length; ++$i) {
            $value = $matches['value'][$i];

            if ('true' === $value || 'false' === $value) {
                $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
            }

            $attributes[$matches['name'][$i]] = $value;
        }

        return $attributes;
    }
private function getAttributes ( $ tag ) { if ( ! preg_match_all ( self :: ATTRIBUTE_REGEX , $ tag , $ matches ) ) { return [ ] ; } $ attributes = [ ] ; for ( $ i = 0 , $ length = count ( $ matches [ 'name' ] ) ; $ i < $ length ; ++ $ i ) { $ value = $ matches [ 'value' ] [ $ i ] ; if ( 'true' === $ value || 'false' === $ value ) { $ value = filter_var ( $ value , FILTER_VALIDATE_BOOLEAN ) ; } $ attributes [ $ matches [ 'name' ] [ $ i ] ] = $ value ; } return $ attributes ; }
Returns attributes of given html-tag.

@param string $tag

@return array
Returns attributes of given html - tag .