Compare commits
No commits in common. "84020a871c301314021d46a8c05c92b537e8056a" and "af212b07ca200fe03ddcbfe6dd9fbf26d72828bf" have entirely different histories.
84020a871c
...
af212b07ca
@ -126,7 +126,7 @@ PATTERN;
|
|||||||
# src: https://stackoverflow.com/a/14550919
|
# src: https://stackoverflow.com/a/14550919
|
||||||
public static function slug(string $text, string $separator = '-') : string
|
public static function slug(string $text, string $separator = '-') : string
|
||||||
{
|
{
|
||||||
$clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $text);
|
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $text);
|
||||||
$clean = preg_replace("/[^a-zA-Z0-9\/_| -]/", '', $clean);
|
$clean = preg_replace("/[^a-zA-Z0-9\/_| -]/", '', $clean);
|
||||||
|
|
||||||
return preg_replace("/[\/_| -]+/", $separator, strtolower(trim($clean, '-')));
|
return preg_replace("/[\/_| -]+/", $separator, strtolower(trim($clean, '-')));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user