I have two array:
$array_1 = array
(
0 => 12,
1 => 14,
2 => 18
);
$array_2 = array
(
0 => 13,
1 => 14,
2 => 22
);
I need only elements which is present in both array.
I've tried array_intersect
but didn't get desired output.
$result = array_intersect($array_1, $array_2);
$result = !empty($result);
print_r($result);
It is giving output 1
instead of 14
.