I have some strings that contain & # 234 ; or other special character, i want to normalise them so i can use them in database, urls etc.
What i started is below, but i can not belief there isn't a php function for it, anyone now which one?
$phrase = 'itali& # 234 ;';
$find =
array("ì","í","î","ï","ï","î","í","ì","ù"
,"ú","û","ü","ü","û","ú","ù","ç","ç","ì",
"í","î","ï","ë","ê","é","è","è",
"é","ê","ë","ë","à","á","â","ã","ä","å","à","á","â",
"ã","ä","å",".","!",",",":",";","'","\"","ù","ú","û",
"ü","ý","þ","ÿ","ù","ú","û","ü","ý",
"þ","ÿ");
$replace = array("i","i","i","i","i","i","i","i","u","u","u","u","u","u","u","u","c","c",
"i","i","i","i","e","e","e","e","e","e","e","e","e","a","a","a","a","a","a","a",
"a","a","a","a","a","","","","","","","","u","u","u","u","u","u","u","u","u","u",
"u","u","u","u");
$slug = str_replace($find, $replace, $phrase);
// slug is : italie