I don't think there is a function for this, I recently created this:
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 included an example of replacing an illegal character with a safe one.
I tested this code and it returns latest-article-about-german-letters---handling-aou-and-ss , so obviously there are some more settings (see ---), but I'm sure it will be easy to adapt.
source share