当在 URL 中找到重复项时,我想:
- 取“分数”并将其添加到原件中
- 获取“引擎”字符串并将其附加到原始字符串
- 然后删除整个重复条目
array 0 => array 'url' => string 'http://blahhotel.com/' 'score' => int 1 'engine' => string 'cheese' 1 => array 'url' => string 'http://www.blahdvd.com/' 'score' => int 2 'engine' => string 'cheese' 2 => array 'url' => string 'http://blahhotel.com/' 'score' => int 1 'engine' => string 'pie' 3 => array 'url' => string 'http://dictionary.reference.com/browse/blah' 'score' => int 2 'engine' => string 'pie' 4 => array 'url' => string 'http://dictionary.reference.com/browse/blah' 'score' => int 1 'engine' => string 'apples'
最后应该是这样的:
array 0 => array 'url' => string 'http://blahhotel.com/' 'score' => int 2 'engine' => string 'cheese, pie' 1 => array 'url' => string 'http://www.blahdvd.com/' 'score' => int 2 'engine' => string 'cheese' 3 => array 'url' => string 'http://dictionary.reference.com/browse/blah' 'score' => int 3 'engine' => string 'pie, apples'