I want to find what words are common between n number of strings. The strings will come from a mysql database. I might be comparing 2 strings, or 200 strings... the number is dynamic.
An example:
input1 = "The credit card was denied because it has expired.";
input2 = "The snowman melted because he expired.";
input3 = "Because the time had expired, the game was over.";
I want to loop through my input strings, explode them, and do some kind of intersection to return this array:
[0] = the
[1] = because
[2] = expired
What do you think is the best way to approach this problem? Because my input strings are in a database, are there any mysql functions that could help?
Thanks and Merry Christmas!!
Mark