There is a regular expression:
$se = preg_replace('%[^A-Za-zА-Ha-H0-9]%', ", $se);
It cuts out all line characters, leaving only letters and numbers. You could rewrite it so that it worked on machines who do not know Cyrillic. To do this, if I understand correctly, the Cyrillic range should be written in the form hex-sequences (such as \\x0410), I can't find how to do it correctly.