3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function _normalizaString($string) { $a = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæèéêëìíîïðñòóôõöøùúûýýþÿ"; $b = "aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaeeeeiiiidnoooooouuuyyby"; $string = strtr(utf8_decode($string), utf8_decode($a), $b); return preg_replace('/\s+/', ' ', trim(strtolower($string), '()[]{}._\t\b')); } echo _normalizaString('açúcar');
Output for 4.3.0 - 7.1.0
a�ucar