0

阵列 1

[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

阵列 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) 如果 url 相同,则替换一个(或者只是删除其中一个 url) (ii) 当 url 相同时,将分数添加到新 url。因此,如果我在一个数组中有 50 个数组,在另一个数组中有 50 个数组,其中 10 个具有相同的 url,那么合并后的数组将总共有 90 个结果,其中 10 个的分数增加。上面合并的示例将有 4 个数组,其中 YOLO count home 得分为 52。

任何人都可以建议如何去做吗?

4

0 回答 0