Reignite Posted June 8, 2010 Share Posted June 8, 2010 Hi everyone! Here goes my first question: how can i combine different characters as the same word in the function in_array() ? for example i have the three words: - "manoseṭṭhā" - "manoseṭthā" - "manoseṭṭha" and in my array ($somearray) is the following word: manosettha then i want for every in_array check for each of the above three words, to match the one allready present in the array (manosettha). Anyone got a suggestion? Thanks! much appreciated! Link to comment https://forums.phpfreaks.com/topic/204223-in_array-utf8-comparison/ Share on other sites More sharing options...
Reignite Posted June 9, 2010 Author Share Posted June 9, 2010 Finally, after lots of searching, here is a solution from php.net: //When doing transliteration, you have to make sure that your LC_COLLATE is properly set, otherwise the default POSIX will be used. //To transform "rené" into "rene" we could use the following code snippet: <?php setlocale(LC_CTYPE, 'nl_BE.utf8'); $string = 'rené'; $string = iconv('UTF-8', 'ASCII//TRANSLIT', $string); echo $string; // outputs rene ?> Link to comment https://forums.phpfreaks.com/topic/204223-in_array-utf8-comparison/#findComment-1069872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.