JBZoo\SimpleTypes\Formatter::htmlAttributes PHP Метод

htmlAttributes() публичный Метод

public htmlAttributes ( array $attributes ) : string
$attributes array
Результат string
    public function htmlAttributes($attributes)
    {
        $result = '';
        $attributes = (array) $attributes;
        if (count($attributes)) {
            foreach ($attributes as $key => $param) {
                $value = implode(' ', (array) $param);
                $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
                $value = trim($value);
                $result .= ' ' . $key . '="' . $value . '"';
            }
        }
        return trim($result);
    }