I am trying to fetch similar words in a string. Suppose I have got a set of 5 keywords.
cats, dogs, animals, food, water
And I have a string like this
"Cat's an animal but different from a dog. Food's not same for both of them. But they both drink water."
If I try to use strpos in this case, I may find only one similar word "water" but in fact there are others too. What can help me achieve to detect all keywords in the sentence mentioned above?