Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Array difference for associate array

Tue Oct 28, 2008 1:18 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", "KS" => "Kansas");
   
$diff = array_diff_assoc($array1, $array2, $array3);
   
print_r($diff);
?>




Post a reply
  Related Posts  to : Array difference for associate array
 output associate array by print_r     -  
 compare an array with another array?     -  
 Pad array to the specified length with a value     -  
 Array size to zero     -  
 PHP Array Functions     -  
 XML Document into an Array in php     -  
 Pop the element off the end of array     -  
 Array Passing     -  
 Shuffle Array     -  
 Array sort     -  

Topic Tags

PHP Arrays