I am making a swedish website, and swedish letters are å, ä, and ö.
I need to make a string entered by a user to become url-safe with PHP.
Basically, need to
as simple as
$str = str_replace(array('å', 'ä', 'ö'), array('a', 'a', 'o'), $str); $str = preg_replace('/[^a-z0-9]+/', '_', strtolower($str));
assuming you use the same encoding for your data and your code.