PluginProbe
Simple Analytics / 1.30
Simple Analytics v1.30
1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.9 1.90 1.91 All 98 releases
simpleanalytics / src / Support / Str.php

Str.php in Simple Analytics 1.30, at src/Support/Str.php

23 lines 448 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SimpleAnalytics\Support;
4
5 class Str
6 {
7 public static function slug(string $value): string
8 {
9 return strtolower(str_replace(' ', '-', $value));
10 }
11
12 public static function htmlAttributes(array $attributes): string
13 {
14 $result = '';
15
16 foreach ($attributes as $key => $value) {
17 $result .= sprintf("%s=\"%s\" ", $key, esc_attr($value));
18 }
19
20 return trim($result);
21 }
22 }
23