Posted By

giak on 01/13/10


Tagged

array pregreplace


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jrobinsonc
guillermoj88gmailcom


PHP : Remove accents


 / Published in: PHP
 

URL: http://www.giacomel.fr

  1. // Remove accents
  2. function neo_remove_accent($l_str){
  3. $l_match = array('/[àâäåãáÂÄÀÅÃÁæÆ]/','/[ß]/','/[çÇ]/','/[Ð]/','/[éèêëÉÊËÈ]/','/[ïîìíÏÎÌÍ]/','/[ñÑ]/','/[öôóòõÓÔÖÒÕ]/','/[__]/','/[ùûüúÜÛÙÚ]/','/[¥_Ý_ýÿ]/','/[__]/');
  4. $l_replace = array('a', 'b', 'c', 'd', 'e', 'i', 'n', 'o', 's', 'u', 'y', 'z');
  5.  
  6. return preg_replace($l_match, $l_replace, $l_str);
  7. }

Report this snippet  

You need to login to post a comment.