<?php
function conv($string)
{
//$string=iconv("CP1251","UTF-8",$string);
//return $string;
$array = explode(" ",$string) ;
foreach ($array as $VAL)
{
$VAL = str_replace("а","а",$VAL); // строчные
$VAL = str_replace("б","б",$VAL);
$VAL = str_replace("в","в",$VAL);
$VAL = str_replace("г","г",$VAL);
$VAL = str_replace("д","д",$VAL);
$VAL = str_replace("е","е",$VAL);
$VAL = str_replace("ё","ё",$VAL);
$VAL = str_replace("ж","ж",$VAL);
$VAL = str_replace("з","з",$VAL);
$VAL = str_replace("и","и",$VAL);
$VAL = str_replace("й","й",$VAL);
$VAL = str_replace("к","к",$VAL);
$VAL = str_replace("л","л",$VAL);
$VAL = str_replace("м","м",$VAL);
$VAL = str_replace("н","н",$VAL);
$VAL = str_replace("о","о",$VAL);
$VAL = str_replace("п","п",$VAL);
$VAL = str_replace("р","р",$VAL);
$VAL = str_replace("с","с",$VAL);
$VAL = str_replace("т","т",$VAL);
$VAL = str_replace("у","у",$VAL);
$VAL = str_replace("ф","ф",$VAL);
$VAL = str_replace("х","х",$VAL);
$VAL = str_replace("ц","ц",$VAL);
$VAL = str_replace("ч","ч",$VAL);
$VAL = str_replace("ш","ш",$VAL);
$VAL = str_replace("щ","щ",$VAL);
$VAL = str_replace("ь","ь",$VAL);
$VAL = str_replace("ы","ы",$VAL);
$VAL = str_replace("ъ","ъ",$VAL);
$VAL = str_replace("э","э",$VAL);
$VAL = str_replace("ю","ю",$VAL);
$VAL = str_replace("я","я",$VAL);
$VAL = str_replace("А","А",$VAL); // заглавные
$VAL = str_replace("Б","Б",$VAL);
$VAL = str_replace("В","В",$VAL);
$VAL = str_replace("Г","Г",$VAL);
$VAL = str_replace("Д","Д",$VAL);
$VAL = str_replace("Е","Е",$VAL);
$VAL = str_replace("Ё","Е",$VAL);
$VAL = str_replace("Ж","Ж",$VAL);
$VAL = str_replace("З","З",$VAL);
$VAL = str_replace("И","И",$VAL);
$VAL = str_replace("Й","Й",$VAL);
$VAL = str_replace("К","К",$VAL);
$VAL = str_replace("Л","Л",$VAL);
$VAL = str_replace("М","М",$VAL);
$VAL = str_replace("Н","Н",$VAL);
$VAL = str_replace("О","О",$VAL);
$VAL = str_replace("П","П",$VAL);
$VAL = str_replace("Р","Р",$VAL);
$VAL = str_replace("С","С",$VAL);
$VAL = str_replace("Т","Т",$VAL);
$VAL = str_replace("У","У",$VAL);
$VAL = str_replace("Ф","Ф",$VAL);
$VAL = str_replace("Х","Х",$VAL);
$VAL = str_replace("Ц","Ц",$VAL);
$VAL = str_replace("Ч","Ч",$VAL);
$VAL = str_replace("Ш","Ш",$VAL);
$VAL = str_replace("Щ","Щ",$VAL);
$VAL = str_replace("Ь","Ь",$VAL);
$VAL = str_replace("Ы","Ы",$VAL);
$VAL = str_replace("Ъ","Ъ",$VAL);
$VAL = str_replace("Э","Э",$VAL);
$VAL = str_replace("Ю","Ю",$VAL);
$VAL = str_replace("Я","Я",$VAL);
$VAL = str_replace("©","©",$VAL);
$VAL = str_replace("$","",$VAL);
$VAL = str_replace("~","",$VAL);
//$VAL = str_replace("&","&",$VAL);
//$VAL = str_replace("$","",$VAL);
$send_VAR .= $VAL." ";
}
$send_VAR=substr($send_VAR, 0, -1);
return $send_VAR;
}
?>