php中的数组,比较2个数组并保留重复值

The following is 2 different definitions of the problem:

How can I process 2 arrays so that I can keep the data of duplicate array[key] values.

I have arrays A and B. I want to create array C with the children that their id/key values exist in both A and B arrays.

Thank you

array_intersect_assoc seems to be what you're looking for