Convert special characters to normal characters using PHP, like ã, é, ç to a, e, c [closed]
I would like to convert special characters to normal characters using PHP.
For example.
ã, á, à, é, ç, ...
to
a, a, a, e, c, ...
It would be great if someone could help me with the issue I'm having.
$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");
preg_replace($ts,$tn, $p);
Make an array of the special characters and an array of the regular character and use preg_replace() on the string like above.
精彩评论