I'm trying to take 2 pieces of text in php like this...
"A cat jumped over the hat"
"The mad hatter jumped over his cat"
And get results like this...
the
cat
jumped
over
(i.e. the common words between the strings, where hat is NOT included because it's part of another word in the second string)
I've found a bunch of examples to help count occurrences of 1 string within another, but that would end up giving me the "hatter" problem so I'm guessing I need to tokenize both strings into word-lists and do one-to-one compares somehow.
Struggling to visualise an efficient way to achieve that though so appreciate any thoughts at all on what the correct approach is. Thanks!