Need a way to output merged content from two arrays

I have two very large arrays I want to recognize where it finds duplicates on the first array, and merges them with the exact array position in another array, and append the value with a comma. I simply cannot wrap my head around how to do it.