alphacooler
Programmer
I have two arrays like the following:
$array1 = array("red", "red", "blue", "green", "blue");
$array2 = array("blue", "blue", "red", "red");
I want to count all of the matches between the two arrays; however, (counting) array_intersect does not work because each array has duplicates (which I want present and counted as matches for as many times as they show up).
I am analyzing two user's tags to compare their similarity.
I'm scratching my head on this one. I'm sure somebody smarter than I has an answer.
$array1 = array("red", "red", "blue", "green", "blue");
$array2 = array("blue", "blue", "red", "red");
I want to count all of the matches between the two arrays; however, (counting) array_intersect does not work because each array has duplicates (which I want present and counted as matches for as many times as they show up).
I am analyzing two user's tags to compare their similarity.
I'm scratching my head on this one. I'm sure somebody smarter than I has an answer.