- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
function ruslat ($string) # Задаём функцию перекодировки кириллицы в транслит.
{
$string = ereg_replace("ж","zh",$string);
$string = ereg_replace("ё","yo",$string);
$string = ereg_replace("й","i",$string);
$string = ereg_replace("ю","yu",$string);
$string = ereg_replace("ь","'",$string);
$string = ereg_replace("ч","ch",$string);
$string = ereg_replace("щ","sh",$string);
$string = ereg_replace("ц","c",$string);
$string = ereg_replace("у","u",$string);
$string = ereg_replace("к","k",$string);
$string = ereg_replace("е","e",$string);
$string = ereg_replace("н","n",$string);
$string = ereg_replace("г","g",$string);
$string = ereg_replace("ш","sh",$string);
$string = ereg_replace("з","z",$string);
$string = ereg_replace("х","h",$string);
$string = ereg_replace("ъ","''",$string);
$string = ereg_replace("ф","f",$string);
$string = ereg_replace("ы","y",$string);
$string = ereg_replace("в","v",$string);
$string = ereg_replace("а","a",$string);
$string = ereg_replace("п","p",$string);
$string = ereg_replace("р","r",$string);
$string = ereg_replace("о","o",$string);
$string = ereg_replace("л","l",$string);
$string = ereg_replace("д","d",$string);
$string = ereg_replace("э","yе",$string);
$string = ereg_replace("я","jа",$string);
$string = ereg_replace("с","s",$string);
$string = ereg_replace("м","m",$string);
$string = ereg_replace("и","i",$string);
$string = ereg_replace("т","t",$string);
$string = ereg_replace("б","b",$string);
$string = ereg_replace("Ё","yo",$string);
$string = ereg_replace("Й","I",$string);
$string = ereg_replace("Ю","YU",$string);
$string = ereg_replace("Ч","CH",$string);
$string = ereg_replace("Ь","'",$string);
$string = ereg_replace("Щ","SH'",$string);
$string = ereg_replace("Ц","C",$string);
$string = ereg_replace("У","U",$string);
$string = ereg_replace("К","K",$string);
$string = ereg_replace("Е","E",$string);
$string = ereg_replace("Н","N",$string);
$string = ereg_replace("Г","G",$string);
$string = ereg_replace("Ш","SH",$string);
$string = ereg_replace("З","Z",$string);
$string = ereg_replace("Х","H",$string);
$string = ereg_replace("Ъ","''",$string);
$string = ereg_replace("Ф","F",$string);
$string = ereg_replace("Ы","Y",$string);
$string = ereg_replace("В","V",$string);
$string = ereg_replace("А","A",$string);
$string = ereg_replace("П","P",$string);
$string = ereg_replace("Р","R",$string);
$string = ereg_replace("О","O",$string);
$string = ereg_replace("Л","L",$string);
$string = ereg_replace("Д","D",$string);
$string = ereg_replace("Ж","Zh",$string);
$string = ereg_replace("Э","Ye",$string);
$string = ereg_replace("Я","Ja",$string);
$string = ereg_replace("С","S",$string);
$string = ereg_replace("М","M",$string);
$string = ereg_replace("И","I",$string);
$string = ereg_replace("Т","T",$string);
$string = ereg_replace("Б","B",$string);
return $string;
}
7ion 23.02.2011 11:22 # +2
Int 23.02.2011 12:52 # +4
koodeer 23.02.2011 18:38 # +2
ShitCode 24.02.2011 00:19 # 0
Lure Of Chaos 24.02.2011 01:05 # +2
nepster 24.02.2011 14:28 # −1
{
$st=strtr($st,"абвгдеёзийклмнопрстуфхъыэ _", "abvgdeeziyklmnoprstufh'iei");
$st=strtr($st,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ _", "abvgdeeziyklmnoprstufh'iei");
$st=strtr($st,
array(
"ж"=>"zh", "ц"=>"ts", " "=>"_", "ч"=>"ch", "ш"=>"sh",
"щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
"Ж"=>"zh", "Ц"=>"ts", "Ч"=>"ch", "Ш"=>"sh",
"Щ"=>"shch","Ь"=>"", "Ю"=>"yu", "Я"=>"ya",
"ї"=>"i", "Ї"=>"yi", "є"=>"ie", "Є"=>"ye"
)
);
return $st;
}
bugmenot 24.02.2011 14:45 # +1
альзо, Є - охуенная буква алфавита
nepster 24.02.2011 14:57 # −2
bugmenot 24.02.2011 16:18 # +1
> После перевода сайта с 1251 в utf-8 появилась проблема
just as planned, kekeke
nepster 24.02.2011 18:16 # 0
istem 25.02.2011 01:19 # 0
setlocale_blabla ("для_началу_понимаишь");
bugmenot 25.02.2011 19:33 # −1
чиста канкретна: я бы вообще не стал такой хуйней заниматься в целях, которые на этом вашем говнофоруме преследуют, и в любом случае скопипастить не дам :-Р
PS: обратное преобразование представляет собой оптимизационную задачу
istem 25.02.2011 01:17 # 0
(простите...)
bugmenot 25.02.2011 20:18 # 0
istem 26.02.2011 00:53 # 0
(простите...)
bugmenot 26.02.2011 01:30 # 0
istem 25.02.2011 01:16 # 0