Просмотр файла file0/conv.php

Размер файла: 3.08Kb
<?php
function conv($string)
{
//$string=iconv("CP1251","UTF-8",$string);
//return $string;
  $array = explode(" ",$string) ;
  foreach ($array as $VAL)
{
$VAL = str_replace("а","&#x0430;",$VAL); // строчные
$VAL = str_replace("б","&#x0431;",$VAL);
$VAL = str_replace("в","&#x0432;",$VAL);
$VAL = str_replace("г","&#x0433;",$VAL);
$VAL = str_replace("д","&#x0434;",$VAL);
$VAL = str_replace("е","&#x0435;",$VAL);
$VAL = str_replace("ё","&#x0451;",$VAL);
$VAL = str_replace("ж","&#x0436;",$VAL);
$VAL = str_replace("з","&#x0437;",$VAL);
$VAL = str_replace("и","&#x0438;",$VAL);
$VAL = str_replace("й","&#x0439;",$VAL);
$VAL = str_replace("к","&#x043A;",$VAL);
$VAL = str_replace("л","&#x043B;",$VAL);
$VAL = str_replace("м","&#x043C;",$VAL);
$VAL = str_replace("н","&#x043D;",$VAL);
$VAL = str_replace("о","&#x043E;",$VAL);
$VAL = str_replace("п","&#x043F;",$VAL);
$VAL = str_replace("р","&#x0440;",$VAL);
$VAL = str_replace("с","&#x0441;",$VAL);
$VAL = str_replace("т","&#x0442;",$VAL);
$VAL = str_replace("у","&#x0443;",$VAL);
$VAL = str_replace("ф","&#x0444;",$VAL);
$VAL = str_replace("х","&#x0445;",$VAL);
$VAL = str_replace("ц","&#x0446;",$VAL);
$VAL = str_replace("ч","&#x0447;",$VAL);
$VAL = str_replace("ш","&#x0448;",$VAL);
$VAL = str_replace("щ","&#x0449;",$VAL);
$VAL = str_replace("ь","&#x044C;",$VAL);
$VAL = str_replace("ы","&#x044B;",$VAL);
$VAL = str_replace("ъ","&#x044A;",$VAL);
$VAL = str_replace("э","&#x044D;",$VAL);
$VAL = str_replace("ю","&#x044E;",$VAL);
$VAL = str_replace("я","&#x044F;",$VAL);

$VAL = str_replace("А","&#x0410;",$VAL); // заглавные
$VAL = str_replace("Б","&#x0411;",$VAL);
$VAL = str_replace("В","&#x0412;",$VAL);
$VAL = str_replace("Г","&#x0413;",$VAL);
$VAL = str_replace("Д","&#x0414;",$VAL);
$VAL = str_replace("Е","&#x0415;",$VAL);
$VAL = str_replace("Ё","&#x0415;",$VAL);
$VAL = str_replace("Ж","&#x0416;",$VAL);
$VAL = str_replace("З","&#x0417;",$VAL);
$VAL = str_replace("И","&#x0418;",$VAL);
$VAL = str_replace("Й","&#x0419;",$VAL);
$VAL = str_replace("К","&#x041A;",$VAL);
$VAL = str_replace("Л","&#x041B;",$VAL);
$VAL = str_replace("М","&#x041C;",$VAL);
$VAL = str_replace("Н","&#x041D;",$VAL);
$VAL = str_replace("О","&#x041E;",$VAL);
$VAL = str_replace("П","&#x041F;",$VAL);
$VAL = str_replace("Р","&#x0420;",$VAL);
$VAL = str_replace("С","&#x0421;",$VAL);
$VAL = str_replace("Т","&#x0422;",$VAL);
$VAL = str_replace("У","&#x0423;",$VAL);
$VAL = str_replace("Ф","&#x0424;",$VAL);
$VAL = str_replace("Х","&#x0425;",$VAL);
$VAL = str_replace("Ц","&#x0426;",$VAL);
$VAL = str_replace("Ч","&#x0427;",$VAL);
$VAL = str_replace("Ш","&#x0428;",$VAL);
$VAL = str_replace("Щ","&#x0429;",$VAL);
$VAL = str_replace("Ь","&#x042C;",$VAL);
$VAL = str_replace("Ы","&#x042B;",$VAL);
$VAL = str_replace("Ъ","&#x042A;",$VAL);
$VAL = str_replace("Э","&#x042D;",$VAL);
$VAL = str_replace("Ю","&#x042E;",$VAL);
$VAL = str_replace("Я","&#x042F;",$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;

} 

?>