I am trying to trim the endings, but unfortunately it does not work. The problem is in UTF-8, tell me how to solve the problem? Instead of the cropped word at the exit, I get the word at the end of the gibberish.
$znach = 'тестовое'; $znach = trim($znach); $reg = "/\.|,|!|\?/i"; $znach = preg_replace($reg,'',$znach); $reg = "/[ый|ой|ая|ое|ые|ому|а|о|у|е|ого|ему|и|ство|ых|ох|ия|ий|ь|я|он|ют|ат]$/"; $znach = preg_replace($reg,'',$znach);
/../iu, if the case is in the encoding - splash58