Skip to content

Instantly share code, notes, and snippets.

@aaoliveira
Created June 12, 2015 15:51
Show Gist options
  • Save aaoliveira/ad90405e13477bad0fb6 to your computer and use it in GitHub Desktop.
Save aaoliveira/ad90405e13477bad0fb6 to your computer and use it in GitHub Desktop.
Remove acentos
function removeAcentos($Msg) {
$a = array (
"/[ÂÀÁÄÃ]/" => "A",
"/[âãàáä]/" => "a",
"/[ÊÈÉË]/" => "E",
"/[êèéë]/" => "e",
"/[ÎÍÌÏ]/" => "I",
"/[îíìï]/" => "i",
"/[ÔÕÒÓÖ]/" => "O",
"/[ôõòóö]/" => "o",
"/[ÛÙÚÜ]/" => "U",
"/[ûúùü]/" => "u",
"/ç/" => "c",
"/Ç/" => "C"
);
return preg_replace(array_keys($a), array_values($a), $Msg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment