So, if I get it right, you want to do a similar comparison with PHP, how would you get a check for checking the general UTF-8 index in MySQL?
The easiest way would be to create a helper function that converts the string according to the utf8_general_ci rules used by MySSQL, which is mainly designed to convert certain letters to a base letter.
The rules for this MySQL sort are listed here:
http:
For example, if you scroll a little to “gold A” on the left, you will see all the characters that are converted to this.
For a helper function called, for example, utf8g_to_ascii() , you can write a function:
function utf8_compare($s1, $s2) { $a = utf8g_to_ascii($s1); $b = utf8g_to_ascii($s2); return strcmp( $a, $b ); }
I would simulate my code after:
http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php
alphadogg
source share