Last active
April 20, 2016 21:28
-
-
Save josecarlosqs/a81c9a6ef182019a52d1cbba25af48dc to your computer and use it in GitHub Desktop.
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
| <?php | |
| // Replace special chars to a alphabetical equivalent. | |
| function normalizar($str){ | |
| $chars = array('á','Á','à','À','â','Â','å','Å','ã','Ã','ä','Ä','æ','Æ','ç','Ç','é','É','è','È','ê','Ê','ë','Ë','í','Í','ì','Ì','î','Î','ï','Ï','ñ','Ñ','ó','Ó','ò','Ò','ô','Ô','ø','Ø','õ','Õ','ö','Ö','ß','ú','Ú','ù','Ù','û','Û','ü','Ü','ÿ'); | |
| $replacement = array('a','A','a','A','a','A','a','A','a','A','a','A','ae','AE','c','C','e','E','e','E','e','E','e','E','i','I','i','I','i','I','i','I','n','N','o','O','o','O','o','O','o','O','o','O','o','O','B','u','U','u','U','u','U','u','U','y'); | |
| return str_replace($chars,$replacement,$str); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment