Posted By

crishnakh on 06/04/08


Tagged

tildes acentos


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

luman
axthos


Reemplazar tildes


 / Published in: PHP
 

  1. function limpiar_acentos($s)
  2. {
  3. $s = ereg_replace(”[áàâãª]”,”a”,$s);
  4. $s = ereg_replace(”[ÁÀÂÃ]”,”A”,$s);
  5. $s = ereg_replace(”[ÍÌÎ]”,”I”,$s);
  6. $s = ereg_replace(”[íìî]”,”i”,$s);
  7. $s = ereg_replace(”[éèê]”,”e”,$s);
  8. $s = ereg_replace(”[ÉÈÊ]”,”E”,$s);
  9. $s = ereg_replace(”[óòôõº]”,”o”,$s);
  10. $s = ereg_replace(”[ÓÒÔÕ]”,”O”,$s);
  11. $s = ereg_replace(”[úùû]”,”u”,$s);
  12. $s = ereg_replace(”[ÚÙÛ]”,”U”,$s);
  13. $s = str_replace(”ç”,”c”,$s);
  14. $s = str_replace(”Ç”,”C”,$s);
  15. $s = str_replace(”[ñ]”,”n”,$s);
  16. $s = str_replace(”[Ñ]”,”N”,$s);
  17.  
  18. return $s;
  19. }

Report this snippet  

You need to login to post a comment.