Array 1
Array 2
I want to merge the arrays above, in such a way that
(i) If the urls are identical, replace one (or alternatively just delete one of the urls) (ii) When the urls are identical add the score to the new url. So if i had 50 arrays in one array, 50 in the other and with 10 of them having identical urls, then the merged array would have a total of 90 results with 10 of them having an increased score. The above example merged would have 4 arrays with YOLO count home having a score of 52.
Can anyone advise on how to go about this?
[0] => Array ( [0] => Urban Dictionary - yolo [1] => http://www.urbandictionary.com/define.php?term=yolo [2] => 3 ) [1] => Array ( [0] => YOLO Colorhouse - Low Odor, Zero VOC Interior Paint with Artist-Crafted Color Palette [1] => http://www.yolocolorhouse.com/ [2] => 2 ) [2] => Array ( [0] => Yolo County - Home [1] => http://www.yolocounty.org/ [2] => 9
Array 2
[0] => Array ( [0] => Yolo Is Intel’s First Smartphone for Africa [1] => http://mashable.com/2013/01/25/intel-yolo/ [2] => 65 [1] => Array ( [0] => YOLO Colorhouse - Low Odor, Zero VOC Interior Paint with Artist-Crafted Color Palette [1] => http://www.yolocolorhouse.com/ [2] => 6 ) [2] => Array ( [0] => Yolo County - Home [1] => http://www.yolocounty.org/ [2] => 43
I want to merge the arrays above, in such a way that
(i) If the urls are identical, replace one (or alternatively just delete one of the urls) (ii) When the urls are identical add the score to the new url. So if i had 50 arrays in one array, 50 in the other and with 10 of them having identical urls, then the merged array would have a total of 90 results with 10 of them having an increased score. The above example merged would have 4 arrays with YOLO count home having a score of 52.
Can anyone advise on how to go about this?