Transliterating search term in another language

If you have PHP’s Intl extension installed, you can use the wonderful Transliterator class.

I get some pretty good results, like this:

$t = Transliterator::create('Latin-Greek', Transliterator::FORWARD );

var_dump( [
    'alfa' => $t->transliterate('alfa'),
    'alpha' => $t->transliterate('alpha'),
] );

Both these greeklish forms give me "άλφα". I don’t know how it knows where to put the accent, but it’s pretty impressive.

Once you have the greek script, the remaining nuances should be taken care of by the database collation. “α” will match “ά” and “σ” will even match “ς” (This works on my system running MySQL with collation utf8mb4_unicode_520_ci)

If you don’t have this extension, or the underlying ICU library isn’t available, then you’d be looking at expanding the characters yourself, but transliteration is hard so I don’t recommend it.