But to get the count, you don't have to iterate over the array_count_values array, unless you want to count multiple matches of the same item (an item that repeats in the first array and matches at least one item in the other).