View Single Post
Old 10-24-2009, 03:23 PM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

you could use a combination of intersect, diff, and merge like this:

PHP Code:
<?php
$arr1 
= array(array("timestamp" => "2009-10-23""key_one" => 45));
$arr2 = array(array("timestamp" => "2009-10-23""another_key" => 1234));
print_r($arr1);
echo 
"<br /><br />";
print_r($arr2);
echo 
"<br /><br />";


$identical array_intersect($arr1[0], $arr2[0]);
$diff array_merge(array_diff($arr1[0], $arr2[0]), array_diff($arr2[0], $arr1[0]));
$merge[0] = array_merge($identical$diff);
print_r($merge);
echo 
"<br /><br />";
?>
this solution just takes into account only 2 arrays, but it can be modified to do for multiple.
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
delayedinsanity (10-24-2009)