I need to be able to replace some common foreign characters with English equivalents before I store values into my db.
For example: æ replace with <
For single character of accents
$str = strtr($str,
"ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÝßàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ",
"AAAAAACEEEEIIIINOOOOOOYSaaaaaaceeeeiiiinoooooouuuuyy");
For double character
of accents (such as Æ, æ
)
$match = array('æ', 'Æ');
$replace = array('ae', 'AE');
$str = str_replace($replace, $replace, $str);