Arrays in php, Compare 2 arrays and keep duplicate values

The following are two different definitions of the problem:

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

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

thank

+3
source share
1 answer

array_intersect_assoc seems to be what you are looking for

+8
source

Source: https://habr.com/ru/post/1737945/


All Articles