View file znak_myxxx.ru/znak_myxxx.ru/functext.php

File size: 1.58Kb
<?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("'","&#039;",$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("&#039;","&apos;",$str);
$str = str_replace("&#","",$str);
$str = str_replace("&#x0410;","A",$str);
$str = str_replace("&#x0412;","B",$str);
$str = str_replace("&#x0415;","E",$str);
$str = str_replace("&#x041a;","K",$str);
$str = str_replace("&#x041c;","M",$str);
$str = str_replace("&#x041d;","H",$str);
$str = str_replace("&#x041e;","O",$str);
$str = str_replace("&#x0420;","P",$str);
$str = str_replace("&#x0421;","C",$str);
$str = str_replace("&#x0422;","T",$str);
$str = str_replace("&#x0425;","X",$str);
$str = str_replace("&#x0430;","a",$str);
$str = str_replace("&#x0435;","e",$str);
$str = str_replace("&#x0438;","u",$str);
$str = str_replace("&#x043a;","k",$str);
$str = str_replace("&#x043e;","o",$str);
$str = str_replace("&#x0440;","p",$str);
$str = str_replace("&#x0441;","c",$str);
$str = str_replace("&#x0443;","y",$str);
$str = str_replace("&#x0445;","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; }
 ?>