public static function array2attrs($assoc){
        $attrs = [];
        foreach ((array) $assoc as $key => $value) {
            $attrs[] = is_string($key)
                ? "$key='$value'"
                : trim($value);
        }
        return implode(' ', $attrs);
    }