PHP array contrast function the existence of an intersection returns true otherwise returns false

  • 2020-03-31 21:31:30
  • OfStack

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

Related articles: