I have an array with multiple arrays within that array and what I want to do is to have the ability to run an array_unique on one of the arrays within my master array, but for every item that array_unique removes, I need it to remove that item from all of the other arrays as well.
For instance:
foreach ($this as $that) {
$test1[] = $that->testing1;
$test2[] = $that->testing2;
$test3[] = $that->testing3;
}
$all = array("Test1" => $test1, "Test2" => $test2, "Test3" => $test3);
So if I want to run an array_unique on $test2 and it removes $test2[4], $test2[7], & $test2[15], then I need it to remove $test1[4], $test3[4], $test1[7], $test3[7], etc.
I'm not exactly sure what the best way to go about doing this is, so I was hoping that someone on here may have an answer since I have found numerous answers here on stackoverflow before. I tried searching everywhere for one, but I think my question is more specific than what I was able to find.
My reasoning behind this is that one of these arrays is loaded with images, but a lot of the images are duplicates, so I want to remove all of the duplicate images. But once I have removed all of the duplicate images, I still have full arrays in the other categories that I don't need any longer.
If you have a better solution to my problem, please let me know. I am really looking for the best solution out there.