Supposing I have an array ("things and stuff", "the stuff"); that I am iterating through to compare each element to each element of another array – assume the second array is ("stuff the blah", "stuff and things to do");
And I want to preg_match anything that is generally relevant – I need it to match elements wherein the words are the same, even though their position has been changed – essentially I want "the stuff" to match "stuff the..." in this case.
What’s the best way to go about this?
You can simply split string of your first array to be compared with all string values on second array, here the example:
References: