Created
December 14, 2011 20:50
-
-
Save dublado/1478451 to your computer and use it in GitHub Desktop.
limpa string - Retirando acentos, caracteres especiais e espaços do nome de um arquivo durante uma operação de upload
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 limpastring($palavra) | |
| { | |
| //$palavra = "açúcar união"; | |
| $palavra = strtolower(ereg_replace("[^a-zA-Z0-9_.]", | |
| "", strtr($nome_antigo, "áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ ", | |
| "aaaaeeiooouucAAAAEEIOOOUUC_"))); | |
| return $palavra; // imprime "acucar_uniao" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment