$text = ""fff/\\\ \ ааа68 9= quota . •_ <br> <br/>`~1!2@3#4$5%6^7&8*9(0)_-)=+\|{[}]':;?.<, ^ {[ lol \ \яяявс12hEEllo0o+_-)(*&^%$#@!~`«»—•— — —– – -- - " —– – ?% % №";
$replace = array(
"а"=>"a","б"=>"b","в"=>"v","г"=>"g","ґ"=>"g","д"=>"d",
"е"=>"e","є"=>"e","ё"=>"e","ж"=>"zh","з"=>"z","и"=>"i",
"і"=>"i","ї"=>"i","й"=>"i","к"=>"k","л"=>"l","м"=>"m","н"=>"n",
"о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u",
"ф"=>"f","х"=>"h","ц"=>"ts","ч"=>"ch","ш"=>"sh","щ"=>"sch",
"ъ"=>"","ы"=>"y","ь"=>"","э"=>"e","ю"=>"yu","я"=>"ya", "ей"=>"yei"
);
$text = strip_tags($text);
$text = strtr(mb_strtolower($text,"UTF-8"),$replace);
$text = preg_replace("|&[a-z]+;|is", "", $text);
$text = preg_replace("|[^a-z0-9 ]|is", "", $text);
$mass = explode(" ",trim($text));
$count = count($mass);
$p = 0;
for($i=0;$i<$count;$i++){
$p++;
$add = ($p != $count)?"-":"";
if($mass[$i] != ''){
$text2 .= $mass[$i].$add;
}
}
echo $text2;
|