I am facing an issue with URLs, I want to be able to convert titles that could contain anything and have them stripped of all special characters so they only have letters and numbers and of course I would like to replace spaces with hyphens.
How would this be done? I've heard a lot about regular expressions (regex) being used...
This should do what you're looking for:
Usage:
Will output:
abcdef-g
Edit: