3v4l.org

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