From ada3beb0a6c649bd9bfc6a87b2fe69ee8ae563f7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 1 Feb 2020 08:57:06 +0100 Subject: initial checkin --- include/utf8/utils/specials.php | 131 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 include/utf8/utils/specials.php (limited to 'include/utf8/utils/specials.php') diff --git a/include/utf8/utils/specials.php b/include/utf8/utils/specials.php new file mode 100644 index 0000000..69219dc --- /dev/null +++ b/include/utf8/utils/specials.php @@ -0,0 +1,131 @@ + +* @param string $string The UTF8 string to strip of special chars +* @param string (optional) $repl Replace special with this string +* @return string with common non-alphanumeric characters removed +* @see utf8_specials_pattern +*/ +function utf8_strip_specials($string, $repl='') +{ + return preg_replace(utf8_specials_pattern(), $repl, $string); +} -- cgit v1.2.3-54-g00ecf