<?
$text = "Этот текст написан по-русски и еще писать. А ты куда идешь?";
$dlina = strlen($text);
echo "$text<br>";
$r_trans = array("а","б","в","г","д","е","ё","ж","з","и","й","к","л","м",
"н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","э",
"ю","я","ъ","ы","ь");
$e_trans = array("a","b","v","g","d","e","e","j","z","i","i","k","l","m",
"n","o","p","r","s","t","u","f","h","c","4","sh","s4",
"e","yu","ya","'","i","'");
for ($i=0;$i<$dlina;$i++)
{
$text = str_replace($r_trans, $e_trans, $text);
}
echo $text."<br>";
$dlina = strlen($text);
for ($i=0;$i<$dlina;$i++)
{
$text = str_replace($e_trans, $r_trans, $text);
}
echo $text."<br>";
for ($i=0;$i<$dlina;$i++)
{
if ($text[$i]== "ч" && $text[$i-1]== "с")
{
$text[$i-1]= "щ";
$text[$i]= "";
}
if ($text[$i]== "х" && $text[$i-1]== "с")
{
$text[$i-1]= "ш";
$text[$i]= "";
}
}
echo $text."<br>";
?>
|