public function removerAcentos($str){
$str = preg_replace('/[áàãâä]/ui', 'a', $str);
$str = preg_replace('/[éèêë]/ui', 'e', $str);
$str = preg_replace('/[íìîï]/ui', 'i', $str);
$str = preg_replace('/[óòõôö]/ui', 'o', $str);
$str = preg_replace('/[úùûü]/ui', 'u', $str);
$str = preg_replace('/[ç]/ui', 'c', $str);
$str = preg_replace('/[^a-z0-9-]/i', ' ', $str);
// $str = preg_replace('/_+/', ' ', $str);
$str = preg_replace('/\s+/', ' ', $str);
return $str;
}
//keep hifen
Created
August 19, 2020 16:17
-
-
Save petronioamaral/12f6e3a18ff5033af2d9c98059903c37 to your computer and use it in GitHub Desktop.
remove accents keep hifen php function
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment