<?php
function FormatText($str) {
@$str = iconv("UTF-8", "CP1251", "$str");
$str = htmlspecialchars($str);
$str=strip_tags($str);
$str=chop($str);
$str=substr($str, 0, 250);
$str = stripslashes($str);
$str = ereg_replace("'","'",$str);
return $str;
}
function k2u($str) {
$str = str_replace("$", "$$", $str); $str = str_replace("і","i",$str);
$str = str_replace("Ї", "I", $str); $str = str_replace("І","I",$str);
$str = str_replace("$", "$$", $str); $str = str_replace("'","'",$str);
$str = str_replace("&#","",$str);
$str = str_replace("А","A",$str);
$str = str_replace("В","B",$str);
$str = str_replace("Е","E",$str);
$str = str_replace("К","K",$str);
$str = str_replace("М","M",$str);
$str = str_replace("Н","H",$str);
$str = str_replace("О","O",$str);
$str = str_replace("Р","P",$str);
$str = str_replace("С","C",$str);
$str = str_replace("Т","T",$str);
$str = str_replace("Х","X",$str);
$str = str_replace("а","a",$str);
$str = str_replace("е","e",$str);
$str = str_replace("и","u",$str);
$str = str_replace("к","k",$str);
$str = str_replace("о","o",$str);
$str = str_replace("р","p",$str);
$str = str_replace("с","c",$str);
$str = str_replace("у","y",$str);
$str = str_replace("х","x",$str);
$str = eregi_replace ("(http://(([a-z,0-9,-,_,.])*))","[URL]",$str);
$str = eregi_replace ("(wap\.(([a-z,0-9,-,_,.])*))","[URL]",$str);
$str = eregi_replace ("(www\.(([a-z,0-9,-,_,.])*))","[URL]",$str);
return $str; }
?>