Just putting here as an alternative (a bit more complex in nature), wordpress uses this function for accent removal. Outputs = Burelle Amélie -> Burelle Amelie $res = strtr($legal_name, $normalizeChars) What worked for me in this instance is using utf8_encode on the string and then using strtr() function after encoding it. Output: E A I A I A I A I C O E O E O E O O e U e U i U i U o Y o a u a y c It will most likely end up with more consistent results.īut if accented characters are the only issue then you could use a dirty strtr (partially from strtr comments): $string = 'Ë À Ì Â Í Ã Î Ä Ï Ç Ò È Ó É Ô Ê Õ Ö ê Ù ë Ú î Û ï Ü ô Ý õ â û ã ÿ ç' In such case, it'd be a good idea to install the GNU libiconv Note that the iconv function on some systems may not work as youĮxpect. The PHP Manual iconv Intro has a warning:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |