I have serveral array's i need to compare...lets say
$href_array
$body_array
$date_array
all the items are "linked"..ie, $href_array[1] relates to $body_array[1] and so on.
now, I have another set of arrays
$href_master_array
$body_master_array
$date_master_array
and they are "linked" in the same way.
what I need to do is compare the two sets of arrays and if anything in $href_array (along with linked arrays) is in $href_master_array (and linked arrays), to not include it, however if it is NOT in $href_master_array, then add it to $href_master_array(as well as all the linked arrays).
I tried something like
$href_diff_array = array_diff($href_master_array, $href_array);
$body_diff_array = array_diff($body_master_array, $body_array);
$news_diff_array = array_diff($news_master_array, $news_array);
$date_diff_array = array_diff($date_master_array, $date_array);
I was thinking I could take the difference and then add that to the master array.
however that does not seem to work. Am I doing something wrong, or just going about the wrong way of doing things?