php – Diacritical marks in the Italian alphabet

Question:

The Italian alphabet contains letters with diacritics: à, è, é, ì, í, î, ò, ó, ù, ú .

The input is a string that may or may not contain such characters.

Question: What is the best way to replace them with the familiar Latin alphabet (i.e. 'à'=>'a', 'è'=>'e' , etc.) without going over every sign?

Answer:

$str = "à, è, é, ì, í, î, ò, ó, ù, ú";
echo iconv('utf-8', 'us-ascii//TRANSLIT', $str);
Scroll to Top