I don't think there is a function to do this, I recently created this though:
function fix_url($word) {
/**
* whilst the descriptor in the url will be for SEO
* purposes only, we need to ensure it doesn't break
* the URI rules http://www.faqs.org/rfcs/rfc2396.html
*/
// convert to lower case
$word=strtolower($word);
// define illegal / replacement characters
$illegal = array("ä","ö","ü","ß");
$replace = array("a","o","u","ss");
$word = str_replace($illegal, $replace, $word);
// remove & for and
$word=str_replace("&","and",$word);
// remove a space for -
$word=str_replace(" ","-",$word);
// and replace all non alphanumeric characters or a dash
$word=ereg_replace("[^A-Za-z0-9-]", "", $word);
return $word;
}
I have included an example of replacing an illegal character with a safe one.
I have tested this code and it returns latest-article-about-german-letters---handling-aou-and-ss
so obviously there are still some tweaks to make (see the ---), butIi'm sure this will be easy to adapt.