I have 2 arrays:
$array1 = array("dog","cat","butterfly")
$array2 = array("dogs","cat","bird","cows")
I need to get all partial matches from $ array2 compared to $ array1, for example:
array("dog","cat")
Therefore, I need to check if there are partial matches of words in $ array2 and output a new array using the keys and values of $ array1.
array_intersection prints only complete matches
thank
source
share