Simpletags::_parse_attributes PHP Method

_parse_attributes() private method

Parses the string of attributes into a keyed array
private _parse_attributes ( $attributes ) : array
return array The keyed array of attributes
    private function _parse_attributes($attributes)
    {
        preg_match_all('/(.*?)\\s*=\\s*(\\042|\\047)(.*?)\\2/is', $attributes, $parts);
        // The tag has no attrbutes
        if (empty($parts[0])) {
            return array();
        } else {
            $attr = array();
            for ($i = 0; $i < count($parts[1]); $i++) {
                $attr[trim($parts[1][$i])] = $parts[3][$i];
            }
        }
        return $attr;
    }