View file file0/trans.php

File size: 2.74Kb
<?php
function trans($string)
{
//$string=iconv("CP1251","UTF-8",$string);
//return $string;
  $array = explode(" ",$string) ;
  foreach ($array as $VAL)
{
$VAL = str_replace("а","a",$VAL); // строчные
$VAL = str_replace("б","b",$VAL);
$VAL = str_replace("в","v",$VAL);
$VAL = str_replace("г","g",$VAL);
$VAL = str_replace("д","d",$VAL);
$VAL = str_replace("е","e",$VAL);
$VAL = str_replace("ё","yo",$VAL);
$VAL = str_replace("ж","zh",$VAL);
$VAL = str_replace("з","z",$VAL);
$VAL = str_replace("и","i",$VAL);
$VAL = str_replace("й","j",$VAL);
$VAL = str_replace("к","k",$VAL);
$VAL = str_replace("л","l",$VAL);
$VAL = str_replace("м","m",$VAL);
$VAL = str_replace("н","n",$VAL);
$VAL = str_replace("о","o",$VAL);
$VAL = str_replace("п","p",$VAL);
$VAL = str_replace("р","r",$VAL);
$VAL = str_replace("с","c",$VAL);
$VAL = str_replace("т","t",$VAL);
$VAL = str_replace("у","u",$VAL);
$VAL = str_replace("ф","f",$VAL);
$VAL = str_replace("х","h",$VAL);
$VAL = str_replace("ц","c",$VAL);
$VAL = str_replace("ч","ch",$VAL);
$VAL = str_replace("ш","sh",$VAL);
$VAL = str_replace("щ","sch",$VAL);
$VAL = str_replace("ь","",$VAL);// т.к. ' нельзя в wml
$VAL = str_replace("ы","y",$VAL);
$VAL = str_replace("ъ","",$VAL);// т.к. ' нельзя в wml
$VAL = str_replace("э","e",$VAL);
$VAL = str_replace("ю","yu",$VAL);
$VAL = str_replace("я","ya",$VAL);

$VAL = str_replace("А","A",$VAL); // заглавные
$VAL = str_replace("Б","B",$VAL);
$VAL = str_replace("В","V",$VAL);
$VAL = str_replace("Г","G",$VAL);
$VAL = str_replace("Д","D",$VAL);
$VAL = str_replace("Е","E",$VAL);
$VAL = str_replace("Ё","YO",$VAL);
$VAL = str_replace("Ж","ZH",$VAL);
$VAL = str_replace("З","Z",$VAL);
$VAL = str_replace("И","I",$VAL);
$VAL = str_replace("Й","J",$VAL);
$VAL = str_replace("К","K",$VAL);
$VAL = str_replace("Л","L",$VAL);
$VAL = str_replace("М","M",$VAL);
$VAL = str_replace("Н","N",$VAL);
$VAL = str_replace("О","O",$VAL);
$VAL = str_replace("П","P",$VAL);
$VAL = str_replace("Р","R",$VAL);
$VAL = str_replace("С","C",$VAL);
$VAL = str_replace("Т","T",$VAL);
$VAL = str_replace("У","U",$VAL);
$VAL = str_replace("Ф","F",$VAL);
$VAL = str_replace("Х","H",$VAL);
$VAL = str_replace("Ц","C",$VAL);
$VAL = str_replace("Ч","CH",$VAL);
$VAL = str_replace("Ш","SH",$VAL);
$VAL = str_replace("Щ","SCH",$VAL);
$VAL = str_replace("Ь","",$VAL);// т.к. ' нельзя в wml
$VAL = str_replace("Ы","Y",$VAL);
$VAL = str_replace("Ъ","",$VAL);// т.к. ' нельзя в wml
$VAL = str_replace("Э","E",$VAL);
$VAL = str_replace("Ю","YU",$VAL);
$VAL = str_replace("Я","YA",$VAL);
//$VAL = str_replace("©","&#169;",$VAL);
//$VAL = str_replace("$","",$VAL);
//$VAL = str_replace("~","",$VAL);
//$VAL = str_replace("&","&amp;",$VAL);
//$VAL = str_replace("$","",$VAL);

$send_VAR .= $VAL." ";

}
$send_VAR=substr($send_VAR, 0, -1);  
return $send_VAR;

} 

?>