View Single Post
Old 01-28-2008, 12:31 AM   #8 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Sam Granger View Post
I know I can do string to lowercase and ' ', '-' replace, but what else can I add for weird symbols like é etc... Whats the easiest way to go round this?
The easiest way (that I can think of right now) to deal with accented characters would be to build some sort of translation table which specifies which ASCII character any given accented character should be converted to. For example, array('à' => 'a', 'é' => 'e' ... 'Ź' => 'Z'). There might be a lot of characters to consider but you'd only have to construct the translation table once.
Salathe is offline  
Reply With Quote