This is a free online url sanitiser is used to make clean urls and encode strings so they are safe for urls.
The first algorithm is strict and only permits lowercase letters, numbers and hyphens. Spaces are replaced replaced with hyphens and multiple hyphens are removed.
The second is less pretty, but a standard urlencode function.