Right now when users press a link in my php webapplications they are send to a page with url's like this: domain.com/faq/item/18483/
or domain.com/blog/item/37476
. But I want to add a title to these url so the user will have a clue what's behind the link (example: I share a link to a friend) like this: domain.com/faq/item/18483/I-have-a-question
.
If I have titles like this:
- this is a faq item
- blog ®!@# message &hello&
What is the best way to sanitize and convert them to this format:
- this-is-a-faq-item
- blog-message-hello
Actually just like stackoverflow does with my title I want to create urls like this: http://stackoverflow.com/questions/22042539/how-to-generate-url-slugs-seo-urls-from-raw-input/