Small, probably meaningless comparison between PHP[g] functions str_replace and preg_replace in processing of common string (un-recommended in the case of preg_replace: no regular expression search or replace: text only and result could be... well... not that one which you expected).
Enter the URL of web-page which is in Russian and choose correct encoding or use ready samples bellow; all page will be transliterated (cyrillic letters to latinic).
<!-- -------- Code start ---- -->
$cyrillic=array(cyrillic alphabet);
$tliter=array(transliterated);
function &cyr2latStr($str) {
return str_replace($cyrillic,$tliter,$str);
// or return preg_replace($cyrillic,$tliter,$str);
}
$string=implode('',file($fileName));
print cyr2latStr($string);
<!-- -------- Code end ---- -->