Computes the intersection of arrays

Tue Oct 28, 2008 12:40 am

Code:

<?php
   $array1
= array("OH" => "Ohio", "CA" => "California", "HI" => "Hawaii");
   
$array2 = array("50" => "Hawaii", "CA" => "California", "OH" => "Ohio");
   
$array3 = array("TX" => "Texas", "MD" => "Maryland", "OH" => "Ohio");
   
$intersection = array_intersect_assoc($array1, $array2, $array3);
   
print_r($intersection);
?>




  Related Posts  to : Computes the intersection of arrays
 can u check tis code to perform union & intersection of list     -  
 Arrays using Pointers     -  
 Defining arrays in ASP     -  
 Arrays in photoshop     -  
 Multidimensional Arrays in JSP     -  
 Concept of arrays     -  
 Arrays in java     -  
 creating arrays in java     -  
 Comparing Arrays in java     -  
 Get union of two arrays set and print it     -  

Topic Tags

PHP Arrays