3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var = "Dorothée"; echo "avant : ".$var; echo "<br />apres : ".minusculesSansAccents($var); function stripAccents($string){ return strtr($string,'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ','aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); } function stripAccents1($string) { $string = utf8_encode($string); return html_entity_decode(preg_replace('~&([A-Za-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);~', '$1', htmlentities($string,ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8'); } function minusculesSansAccents($texte) { $texte = str_replace( array('à','â','ä','á','ã','å','î','ï','ì','í','ô','ö','ò','ó','õ','ø','ù','û','ü','ú','é','è','ê','ë','ç','ÿ','ñ'), array('a','a','a','a','a','a','i','i','i','i','o','o','o','o','o','o','u','u','u','u','e','e','e','e','c','y','n'), $texte ); return $texte; }
based on X51kW
Output for 4.3.0 - 7.2.6
avant : Dorothée<br />apres : Dorothee