Answer the question
In order to leave comments, you need to log in
How to get only exactly matching array elements?
Let's say there are 4 arrays:
array(4) { [0]=> string(1) "1" [1]=> string(1) "2" [1]=> string(1) "3" [2]=> string(1) "4" }
array(3) { [0]=> string(1) "2" [1]=> string(1) "3" [2]=> string(1) "4" }
array(2) { [0]=> string(1) "2" [1]=> string(1) "3" }
array(2) { [0]=> string(1) "2" [1]=> string(1) "3" }
Answer the question
In order to leave comments, you need to log in
php.net/manual/ru/function.array-intersect.php
In general, solve the issue as it comes. You understand that writing foreach is simply much easier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question