I must delete words if in word have letters "ц", "щ", "ы", "ь". I create this functions for need me but it works slow.
public function CheckToInsert($text)
{
$xarfho = array("ц", "щ", "ы", "ь","қ","ӣ","ғ","ҷ","ҳ","ӯ","Қ","Ӣ","Ғ","Ҷ","Ҳ","Ӯ");
foreach ($xarfho as $xarf)
{
if (stripos($text,$xarf) !== false)
{
return true;
}
}
return false;
}
public function UnsetUncorrectWords($words)
{
foreach ($words as $key => $value)
{
if($this->CheckToInsert($value) == false) unset($words[$key]);
if(strlen($value) < 3) unset($words[$key]);
}
return $words;
}