$string = "Café au lait"; $unaccented = replaceAccentedChars($string); echo $unaccented; // Outputs "Cafe au lait"
$array = array("Café au lait", "Möbius strip", "Éclair"); foreach ($array as $string) { echo replaceAccentedChars($string) . "There are several PHP packages and libraries that include the replaceAccentedChars function, such as the Symfony String component and the Laravel Str helper functions. However, it is also a simple function that can be added to your own custom code or included in a utility library.
"; } // Outputs: // Cafe au lait // Mobius strip // Eclair