Anyone know of any function to replace letters with accents with just the regular letter, for instance replace á with a, ç with c, ñ with n ?
How about this ??? This is the one I made for this purpose
function stripAccents($string) {
$returnString = strtr($string,
'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ', 'aaaaaceeeeiiiinooooosuuuuyAAAAACEEEEIIIINOOOOOSUUUUY');
$returnString = str_replace('æ','ae',str_replace('Æ','AE',$returnString));
$returnString = str_replace('ø','o',str_replace('Ø','O',$returnString));
$returnString = str_replace('å','a',str_replace('Å','å',$returnString));
$returnString = str_replace('ß','ss',$returnString);
$returnString = str_replace(''','',str_replace("'",'',$returnString));
$returnString = str_replace('"','',str_replace('"','',$returnString));
return $returnString;
}
obviously there's room for improvement, but it's from a QAD script (not production)
-- Rene Brehmer aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile?
http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php