I wrote this code, it seems to work but not quite as it should.
$search = "как твои дела"; $text = "привет, как твои дела? давай созвонимся."; $pos1 = stripos($text, $search); if ($pos1 !== false) { echo 'Найден '.$search; } The code above perfectly looks for the word “how are you” in the line, but if you look for the word “yes” for example, then it will find it in “come on,” but the search word “yes” itself is a separate word, and it finds it as two letters in the text.
How to write so that it was searched for words or word combinations?