3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? /* UTF-8 sin BOM (€ÁÑ) */ header('Content-Type: text/plain; charset=utf-8'); error_reporting(-1); ini_set('display_errors', true); mb_internal_encoding('UTF-8'); setlocale(LC_CTYPE, 'es_ES.utf8', 'Spanish_Spain'); $cadena = 'autotaller Güelfo'; BuscadorTexto::normalizarNombre($cadena); class BuscadorTexto{ public static function normalizarNombre($cadena){ $cadena = utf8_decode($cadena); //$cadena = preg_replace('@[^\\pL\d\s]+@', ' ', $cadena); } } ?> OK
Output for 5.4.0 - 7.1.0
OK
Output for 4.3.0 - 5.3.29
<? /* UTF-8 sin BOM (€ÁÑ) */ header('Content-Type: text/plain; charset=utf-8'); error_reporting(-1); ini_set('display_errors', true); mb_internal_encoding('UTF-8'); setlocale(LC_CTYPE, 'es_ES.utf8', 'Spanish_Spain'); $cadena = 'autotaller Güelfo'; BuscadorTexto::normalizarNombre($cadena); class BuscadorTexto{ public static function normalizarNombre($cadena){ $cadena = utf8_decode($cadena); //$cadena = preg_replace('@[^\\pL\d\s]+@', ' ', $cadena); } } ?> OK