Created
June 12, 2015 15:51
-
-
Save aaoliveira/ad90405e13477bad0fb6 to your computer and use it in GitHub Desktop.
Remove acentos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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