SoFunction
Updated on 2025-03-03

PHP array comparison function, if there is intersection, return true, otherwise return false


<?php
$array1 = array('a', 'b', 'c', 'd');
$array2 = array('a', 'c');
$array3 = array_intersect($array1, $array2);
if($array3) {
echo 'has intersection';
}
?>