magnetica Posted July 31, 2010 Share Posted July 31, 2010 Hi all I was wondering if you are able to replace such characters as â with a in php? Regards Magnetica Quote Link to comment https://forums.phpfreaks.com/topic/209447-how-to-replace-characters-like-%C3%A2/ Share on other sites More sharing options...
Zane Posted July 31, 2010 Share Posted July 31, 2010 str_replace("â","a", "Banâna"); Also, to get more complex.. there's $stuff = "èœsy Strëët"; $s = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u"); $r = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u"); $newVar = str_replace($s, $r, $stuff); http://www.randomsequence.com/articles/removing-accented-utf-8-characters-with-php/ Quote Link to comment https://forums.phpfreaks.com/topic/209447-how-to-replace-characters-like-%C3%A2/#findComment-1093596 Share on other sites More sharing options...
magnetica Posted July 31, 2010 Author Share Posted July 31, 2010 Such as â.. What character it is could be any? Is there a function to convert of replace letters by encoding? Quote Link to comment https://forums.phpfreaks.com/topic/209447-how-to-replace-characters-like-%C3%A2/#findComment-1093597 Share on other sites More sharing options...
magnetica Posted July 31, 2010 Author Share Posted July 31, 2010 Thanks alot Zanus.. Can't see it getting more complicated then the characters you have put there Quote Link to comment https://forums.phpfreaks.com/topic/209447-how-to-replace-characters-like-%C3%A2/#findComment-1093598 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.