Possible Duplicate:
Automatic clean and SEO friendly URL (slugs)
I need a function which makes “clean URL strings” like WordPress.
For example:
“This is a string with frénch and gêrmän special chars + other mean stuff and I’d like to use it as an URL”
Shall be transformed into this:
“this-is-a-string-with-french-and-german-special-chars-other-mean-stuff-and-id-like-to-use-it-as-an-url”
Please help my laziness, it was a hard day already 🙂
I’ll help your laziness today by providing the hint to what you will need to work on tomorrow:
There can be many variations of this, for example using RegEx (
preg_replace) to match some groups of characters like multiple spaces/tabs/newlines (\s*) or multiple characters that are supposed to have the same replacement (ă|â|ä).