Created
September 26, 2018 12:43
-
-
Save adlerdias/4d3725862055bcb155d172d40f7c0339 to your computer and use it in GitHub Desktop.
PHP - Remove latin characters
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
| namespace App\Helpers; | |
| class Clear | |
| { | |
| /** | |
| * Remove os caracteres acentuados da string | |
| * @param string $string | |
| * @return string | |
| */ | |
| public static function removerAcentuados(string $string) : string | |
| { | |
| $transliterator = \Transliterator::create('Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove'); | |
| return $transliterator->transliterate($string); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment