Posted By

luman on 06/30/06


Tagged

replace character


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

postNuKe


check_nome


 / Published in: PHP
 

  1. function check_nome ($nome) {
  2. $busca = array (
  3. 'á','é','í','ó','ú','à','è','ì','ò','ù',
  4. 'â','ê','î','ô','û','ä','ë','ï','ö','ü',
  5. 'Á','É','Í','Ó','Ú','À','È','Ì','Ò','Ù',
  6. 'Â','Ê','Î','Ô','Û','Ä','Ë','Ï','Ö','Ü',
  7. 'ñ','Ñ','ç','Ç',' ','(',')','?','¿','/',
  8. '#','º','ª','!','·','#','%','¬','=','¡',
  9. '^',';','"',"'",'+','[',']','{','}',';',
  10. '~','¤','¶','ø','þ','æ','ß','ð','«','»',
  11. '¢','µ','€','\\',':','*','<','>','|','$',
  12. '&','@');
  13. $cambia = array (
  14. 'a','e','i','o','u','a','e','i','o','u',
  15. 'a','e','i','o','u','a','e','i','o','u',
  16. 'A','E','I','O','U','A','E','I','O','U',
  17. 'A','E','I','O','U','A','E','I','O','U',
  18. 'n','N','c','C','_','_','_','_','_','_',
  19. '_','o','a','_','_','_','_','_','_','_',
  20. '_','_','_','_','_','_','_','_','_','_',
  21. '_','_','_','_','_','_','_','_','_','_',
  22. '_','_','_','_','_','_','_','_','_','_',
  23. '_','_');
  24.  
  25. return str_replace($busca, $cambia, trim($nome));
  26. }

Report this snippet  

You need to login to post a comment.