I have 2 arrays:
a1 = 1,2,3,4,5,6,7,8
a2 = 1,3,5,7
I want to be able to compare both arrays where they match, combine them without duplicates and then attach a prefix or letter to the matching values.
expected result:
a3 - match1,2,match3,4,match5,6,match7,8
I have looked at array_intersect()
, but I'm not sure how I would use it in my example.