Saturday, 15 March 2014

How to make joins between arrays filled by integers in PhP? -



How to make joins between arrays filled by integers in PhP? -

what seek bring together between 2 arrays filled integers. result have :

1st array -> [1] [2] [3] [4] 2nd array -> [2] [4] [6] [8]

join between these array -> [2] [4] because these numbers appear in both arrays.

is there kind of function result in php ? found around implode seems not searching for. has thought ?

you can utilize array_intersect() :

array_intersect($array1,$array2); demo

php arrays

No comments:

Post a Comment