diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-11-12 11:11:58 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-11-12 11:11:58 +0100 |
commit | 89b05effb2eb45382762fcfcfae2373b7754caa7 (patch) | |
tree | de7a5298f1ef7a095c4b99e684c80b9152c686b1 /app/fn/fn.php | |
parent | a64af357ff41a61f5248e2052274315b390e979c (diff) | |
download | wcms-89b05effb2eb45382762fcfcfae2373b7754caa7.tar.gz wcms-89b05effb2eb45382762fcfcfae2373b7754caa7.zip |
url-cleaning-redirect-correct-id
Diffstat (limited to 'app/fn/fn.php')
-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))); +} + |