$str = mb_strtolower(trim($string),'UTF-8');
if (mb_strlen($str) > 1)
{
$br = preg_split('//',$str,-1,PREG_SPLIT_DELIM_CAPTURE);
foreach ($br as $value)
{
$out .= array_search($value,$trans);
}
}
else
$out .= array_search($str,$trans);
if($out != $string)
return $out;
else
return 'e'.$string;
echo("<!-- Debug: '".$str."' ==== '".mb_convert_encoding($str, "UTF-8")."' -->");
, и проверяйте текст страницы.