# simpleanalytics/1.72/src/Support/Str.php

Simple Analytics, version 1.72. 23 lines.

- Page: https://pluginprobe.com/plugins/simpleanalytics/1.72/code/src/Support/Str.php
- Raw: https://pluginprobe.com/plugins/simpleanalytics/1.72/raw/src/Support/Str.php
- Modified: 2024-09-13T11:41:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/simpleanalytics/1.72/code/src/Support/Str.php#L10-L20`.

```php
<?php

namespace SimpleAnalytics\Support;

class Str
{
    public static function slug(string $value): string
    {
        return strtolower(str_replace(' ', '-', $value));
    }

    public static function htmlAttributes(array $attributes): string
    {
        $result = '';

        foreach ($attributes as $key => $value) {
            $result .= sprintf("%s=\"%s\" ", $key, esc_attr($value));
        }

        return trim($result);
    }
}

```
