- str_replace: documentation ( source)
- trim: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
- str_split: documentation ( source)
<?php
function _normalizaString($string)
{
$a = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ";
$b = "aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr";
$string = str_replace(str_split($a), str_split($b), $string);
return preg_replace('/\s+/', ' ', trim(strtolower($string), '()[]{}._\t\b\r'));
}