-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathComparison.php
executable file
·46 lines (42 loc) · 1.67 KB
/
Comparison.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
class Comparison {
public function __construct(array &$googleList, array &$yahooList, array &$bingList)
{
$this->googleAndYahooComparison($googleList,$yahooList);
$this->googleAndBingComparison($googleList,$bingList);
$this->yahooAndBingComparison($yahooList,$bingList);
}
public function googleAndYahooComparison(array &$googleList, array &$yahooList) {
for ($i = 0; $i < count($googleList); $i++) {
for($j = 0; $j < count($yahooList); $j++) {
if(strpos($googleList[$i]['href'], $yahooList[$j]['href']) !== false) {
$googleList[$i]['yahoo'] = $j + 1;
$yahooList[$j]['google'] = $i + 1;
break;
}
}
}
}
public function googleAndBingComparison(array &$googleList, array &$bingList) {
for ($i = 0; $i < count($googleList); $i++) {
for($j = 0; $j < count($bingList); $j++) {
if(strpos($googleList[$i]['href'], $bingList[$j]['href']) !== false) {
$googleList[$i]['bing'] = $j + 1;
$bingList[$j]['google'] = $i + 1;
break;
}
}
}
}
public function yahooAndBingComparison(array &$yahooList, array &$bingList) {
for ($i = 0; $i < count($yahooList); $i++) {
for($j = 0; $j < count($bingList); $j++) {
if(strpos($yahooList[$i]['href'], $bingList[$j]['href']) !== false) {
$yahooList[$i]['bing'] = $j + 1;
$bingList[$j]['yahoo'] = $i + 1;
break;
}
}
}
}
}