我试图转换像下面的字符:
ë,ä,ï,ö,etc.
对于普通字符,例如:
e,a,i,o,etc.
做这个的最好方式是什么?
我尝试过很多东西,比如preg_replace和str_replace.
有人可以帮我吗?
– 编辑 –
我试过的是:
$ts = array("[À-Å]","Æ","Ç","[È-Ë]","/[Ì-Ï]/","/Ð/","/Ñ/","/[Ò-ÖØ]/","/×/","/[Ù-Ü]/","/[Ý-ß]/","/[à-å]/","/æ/","/ç/","/[è-ë]/","/[ì-ï]/","/ð/","/ñ/","/[ò-öø]/","/÷/","/[ù-ü]/","/[ý-ÿ]/"); $tn = array("A","AE","C","E","I","D","N","O","X","U","Y","a","ae","c","e","i","d","n","o","x","u","y"); $title = preg_replace($ts,$tn,$text);
试试这个……对我有用.
原文链接:https://www.f2er.com/php/136297.htmliconv('utf-8','ascii//TRANSLIT',$text);