I have some difficulties to get some good idea how to divide values from arrays. For example I have 3 arrays of URLs:
$urlsFromA = ['http://www.test.com', 'http://www.example.com', 'http://www.google.com', 'http://www.twitter.com'];
$urlsFromB = ['https://www.test.com', 'http://www.example.com', 'http://www.bing.com'];
$urlsFromC = ['http://www.test.com', 'http://www.google.com'];
I need to foreach
all of the arrays and get to other arrays values which I have duplicates in these start arrays and remove from start arrays if they occurred in the others.
It is a little hindrance. Because URLs can be difference by 'https' for example but I must treat them like they are the same. So my result will be arrays with URLs named as a Source of this URLs:
$urlsFromABC = ['http://www.test.com'];
$urlsFromAB = ['http://www.example.com'];
$urlsFromAC = ['http://www.google.com'];
$urlsFromBC = [];
$dataFromA = ['http://www.twitter.com'];
$urlsFromB = ['http://www.bing.com'];
$urlsFromC = [];
In $urlsFromABC I have URL which was in all arrays on start (despite the fact that it is different because of 'https'). In starting arrays ($dataFromA ,$urlsFromB, $urlsFromC) should be URLs that are not duplicated in other start arrays. Maybe someone have idea how can I do this?