I have two arrays with some user-id
$array1 = array("5","26","38","42");
$array2 = array("15","36","38","42");
What I need is, I need the common values from the array as follows
$array3 = array(0=>"38", 1=>"42");
I have tried array_intersect()
. I would like to get a method that takes a minimum time of execution. Please help me, friends.