Creating a ‘slug’

SEO is becoming more and more important, and URL’s need to be more visible. Here’s a function for creating a ‘slug’ which I used as an add-on to a site, using the page title.