$array1=array( 0=>array('id'=>'1','userid'=>'10'),
1=>array('id'=>'2','userid'=>'22'),
2=>array('id'=>'3','userid'=>'33'),
3=>array('id'=>'7','userid'=>'77'));
$array2=array( 0=>array('id'=>'2','userid'=>'22'),
1=>array('id'=>'3','userid'=>'33'),
2=>array('id'=>'4','userid'=>'44'),
3=>array('id'=>'5','userid'=>'55'),
4=>array('id'=>'6','userid'=>'66'));
echo "<pre>";
$mix = array();
foreach($array2 as $k=>$value)
{
if(!in_array($value,array_values($array1))){
$array1[] = $value;
}
}
function sortById($a, $b) {
return $a['id'] - $b['id'];
}
usort($array1, 'sortById');
print_r($array1);
exit;