Using The Array_Intersect () Function

 
     <?php
  $arrayone = array ("A", "B", "C", "D");
  $arraytwo = array ("C", "D", "E", "F");
 
  $similarity = array_intersect ($arrayone, $arraytwo);
  foreach ($similarity as $val) {
     echo "$val", "\n";
  }
 ?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.