User friendly url from function
<p>I'm having some hard time, dealing with a cms that generates english characters only for the url, i need to make it suitable for Portugal, a Latin Country that handles special characters.</p>

<p>The function that creates the links is:</p>

<pre><code>    function generateSafeUrls($url = '') {
    ## normalize accented characters
    $url = strtr($url, "\xA1\xAA\xBA\xBF\xC0\xC1\xC2\xC3\xC5\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD\xE0\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8\xF9\xFA\xFB\xFD\xFF\ã", "_ao_AAAAACEEEEIIIIDNOOOOOUUUYaaaaaceeeeiiiidnooooouuuyy"); 
    ## further character processing
    $url = strtr($url, array("\xC4"=&gt;"Ae", "\xC6"=&gt;"AE", "\xD6"=&gt;"Oe", "\xDC"=&gt;"Ue", "\xDE"=&gt;"TH", "\xDF"=&gt;"ss", "\xE4"=&gt;"ae", "\xE6"=&gt;"ae", "\xF6"=&gt;"oe", "\xFC"=&gt;"ue", "\xFE"=&gt;"th", "\ã"=&gt;"a"));
    ## make sure its only english and dashes
    $search = array("/[^a-zA-Z0-9\/]/", "/--+/");
    $replace = array("-", "-");
    $url = preg_replace($search, $replace, $url);
    ## return safe url
    return($url);
}
</code></pre>

<p>I can see that the function replaces the spaces with "-", what would be great is that if the function replaced "ç" for "ç", "ã" for "a" and so on. The thing is, that i don't have a clue about how to make it.</p>

<p>I don't want to make you work as i always say, give me tips and hints and i will be so much appreciated ;)</p>

<p>Kind regards to all of you! Thanks!</p>
