How to get string in English from the Russian line?

Hello. I have for example the string "Hello" how do I get out of it "Privet"?
July 2nd 19 at 14:20
5 answers
July 2nd 19 at 14:22
Solution
htmlweb.ru/php/example/translit.php?str=%EF%F0%E8%...

<?php
 function translit($str) {
 $rus = array('A', 'B', 'In', 'G', 'D', 'E', 'E', 'W', 'Z', 'And', 'Th', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'Y', 'f', 'X', 'TS', 'CH', 'sh', 'Sch', 'b', 'S', 'S', 'e', 's', 'I', 'a', 'b', 'in', 'g', 'd', 'e', 'e', 'W', 'z', 'and', 'th', 'K', 'l', 'm', 'n', 'o', 'p', 'R', 's', 't', 'y', 'f', 'x', 'C', 'CH', 'sh', 'Sch', 'b', 's', 's', 'e', 's', 'I');
 $lat = array('A', 'B', 'V', 'G', 'D', 'E', 'E', 'Gh', 'Z', 'I', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'C', 'Ch', 'Sh', 'Sch', 'Y', 'Y', 'Y', 'E', 'Yu', 'Ya', 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'gh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya');
 return str_replace($rus, $lat, $str);
}
 translit echo("Hello world!");
?>


sandbox.onlinephpfunctions.com/code/2280147489c1e5...
July 2nd 19 at 14:24
$arr = array("A" => "A", "B" => "B");
If you do not mind in the Cyrillic keys.
July 2nd 19 at 14:26
July 2nd 19 at 14:28
July 2nd 19 at 14:30

Find more questions by tags PHP