| 12345678910111213141516 |
- <?php
- namespace App;
- class Util {
- public static function slug(string $string, string $glue = "-"): string {
- $string = strtolower($string);
- return preg_replace("/[^a-z\d]+/i", $glue, $string);
- }
- public static function createDirectory(string $path): bool {
- return !mkdir($path, 0777, true) && !is_dir($path);
- }
- }
|