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
// normalize data (remove accent marks) using PHP's *intl* extension $data = normalizer_normalize($data); // replace everything NOT in the sets you specified with an underscore $data = preg_replace("#[^A-Za-z1-9]#","_", $data);