Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
<?php
function translit($ru_str) {
$razd="_";
$cyr_str=strtolower($ru_str);
$tr = array("А"=>"a","Б"=>"b","В"=>"v","Г"=>"g",
"Д"=>"d","Е"=>"e","Ж"=>"zh","З"=>"z","И"=>"i",
"Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n",
"О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t",
"У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch",
"Ш"=>"sh","Щ"=>"sch","Ъ"=>"","Ы"=>"y","Ь"=>"",
"Э"=>"e","Ю"=>"u","Я"=>"ya","а"=>"a","б"=>"b",
"в"=>"v","г"=>"g","д"=>"d","е"=>"e","ж"=>"zh",
"з"=>"z","и"=>"i","й"=>"y","к"=>"k","л"=>"l",
"м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
"с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h",
"ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"sch","ъ"=>"",
"ы"=>"y","ь"=>"","э"=>"e","ю"=>"u","я"=>"ya", " " => $razd);
$text= strtr($ru_str, $tr);
$text=preg_replace("/[^a-z0-9_ -]*/", "", $text);
return $text;
}
$text = translit("Крепкий орешек");
echo $text;
?>
PHP:function translit($ru_str) { $razd="_"; $cyr_str=strtolower($ru_str); $tr = array("А"=>"a","Б"=>"b","В"=>"v","Г"=>"g", "Д"=>"d","Е"=>"e","Ж"=>"zh","З"=>"z","И"=>"i", "Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n", "О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t", "У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch", "Ш"=>"sh","Щ"=>"sch","Ъ"=>"","Ы"=>"y","Ь"=>"", "Э"=>"e","Ю"=>"u","Я"=>"ya","а"=>"a","б"=>"b", "в"=>"v","г"=>"g","д"=>"d","е"=>"e","ж"=>"zh", "з"=>"z","и"=>"i","й"=>"y","к"=>"k","л"=>"l", "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r", "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h", "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"sch","ъ"=>"", "ы"=>"y","ь"=>"","э"=>"e","ю"=>"u","я"=>"ya", " " => $razd); $text= strtr($ru_str, $tr); $text=preg_replace("/[^a-z0-9_ -]*/", "", $text); return $text; }
А в транслите вообще есть какие-то стандарты?
Например как будет правильно?
так:
krepkiy
или так:
krepkii
<?php
header('Content-Type:text/plain; charset=UTF-8');
$file_in = "ru_movies.txt"; // Your input file
$file_out = "tr_movies.txt"; // Your output file
// Open and read the file with Russian movies
$fn = fopen($file_in, "r");
while (!feof($fn)) {
$content .= fgets($fn);
}
fclose($fn);
// Translit everything
$new_content = translit($content);
// Write to Translit file
$fn = fopen($file_out, "w");
fwrite($fn, $new_content);
fclose($fn);
// GG function
function translit($ru_str) {
$razd="_";
$cyr_str=strtolower($ru_str);
$tr = array("А"=>"a","Б"=>"b","В"=>"v","Г"=>"g",
"Д"=>"d","Е"=>"e","Ж"=>"zh","З"=>"z","И"=>"i",
"Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n",
"О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t",
"У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch",
"Ш"=>"sh","Щ"=>"sch","Ъ"=>"","Ы"=>"y","Ь"=>"",
"Э"=>"e","Ю"=>"u","Я"=>"ya","а"=>"a","б"=>"b",
"в"=>"v","г"=>"g","д"=>"d","е"=>"e","ж"=>"zh",
"з"=>"z","и"=>"i","й"=>"y","к"=>"k","л"=>"l",
"м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
"с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h",
"ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"sch","ъ"=>"",
"ы"=>"y","ь"=>"","э"=>"e","ю"=>"u","я"=>"ya", " " => $razd);
$text= strtr($ru_str, $tr);
return $text;
}
?>
А в транслите вообще есть какие-то стандарты?
$gost = array(
"Є"=>"EH","І"=>"I","і"=>"i","№"=>"#","є"=>"eh",
"А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
"Е"=>"E","Ё"=>"JO","Ж"=>"ZH",
"З"=>"Z","И"=>"I","Й"=>"JJ","К"=>"K","Л"=>"L",
"М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
"С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"KH",
"Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
"Ы"=>"Y","Ь"=>"","Э"=>"EH","Ю"=>"YU","Я"=>"YA",
"а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
"е"=>"e","ё"=>"jo","ж"=>"zh",
"з"=>"z","и"=>"i","й"=>"jj","к"=>"k","л"=>"l",
"м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
"с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"kh",
"ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
"ы"=>"y","ь"=>"","э"=>"eh","ю"=>"yu","я"=>"ya","«"=>"","»"=>"","—"=>"-"
);
$iso = array(
"Є"=>"YE","І"=>"I","Ѓ"=>"G","і"=>"i","№"=>"#","є"=>"ye","ѓ"=>"g",
"А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
"Е"=>"E","Ё"=>"YO","Ж"=>"ZH",
"З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L",
"М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
"С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"X",
"Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
"Ы"=>"Y","Ь"=>"","Э"=>"E","Ю"=>"YU","Я"=>"YA",
"а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
"е"=>"e","ё"=>"yo","ж"=>"zh",
"з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l",
"м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
"с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"x",
"ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
"ы"=>"y","ь"=>"","э"=>"e","ю"=>"yu","я"=>"ya","«"=>"","»"=>"","—"=>"-"
);
Вот этот скрипт мож подойдет ))))Нужен скрипт или программа чтобы туда можно было ввести название фильма, а потом этот скрипт или программа выдавала транслит. типа Крепкий орешек после обработки krepkii_orechek