diff options
Diffstat (limited to 'app/fn')
-rw-r--r-- | app/fn/fn.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php index 029e9d3..03bb2d0 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -70,6 +70,16 @@ function arrayclean($input) return $output; } +function idclean(string $input) +{ + $input = urldecode($input); + $search = ['é', 'à', 'è', 'ç', ' ']; + $replace = ['e', 'a', 'e', 'c', '-']; + $input = str_replace($search, $replace, $input); + + return preg_replace('%[^a-z0-9-_+]%', '', strtolower(trim($input))); +} + |