actuall the one that i wrote is just to illustrate..my real array is like this..all the array got consistent arrangement of values...
$g_res[$i] = array($g_URL[$i],$g_arr[$i],'Google');
$y_res[$i] = array($y_URL[$i],$y_arr[$i],'Yahoo');
$a_res[$i] = array( $a_URL[$i],$a_array[$i],'Altavista');
ok now...say like google results and yahoo results rite..basically there will be similar URL between these two search engine..say g_res[1] is got similar URL with y_res[2]...and because i just retrieve only the first page(top ten)..there will be no duplucate results from the same search engine..like g_res[1] with other g_res[$i]..
that's why i just need to compare like that..i were to compare all of it that will be a waste..i think laa..
so basically ..
if g_res[1] == y_res[1]
unset(y_res[1]);
then move on to ...
if g_res[1] == a_res[3];
unset(a_res[3]);
if g_res[2] != y_res[2]
then move on to y_res[3]..until found the same URL of end of y_res[]..before move on to a_res...
i hope i make this clear..
here my coding..but it is not yet working...
maybe u can give some comment.. 🙂
i want to make it recursive..
$counter = count($y_res);
$i=$j=$x=1;
Rec($y_res, $a_res,$i,$j);
function Rec($y_res, $a_res,$i,$j){
//COMPARING GOOGLE AND YAHOO
echo $y_res[$i][0]."<br>".$a_res[$j][0]."<br>";
if(strcmp($y_res[$i][0],$a_res[$j][0])!==FALSE){ // if found the similar string
//unset($a_res[$j]);
if($i<=count($y_res)){
Rec($y_res, $a_res,$i++,$j);
}
else{
break;
}
}
else{ //else not found
if($j<=count($a_res)){
Rec($y_res, $a_res,$i,$j++);
}
else{
break;
}
}//end else for google and yahoo=for found
//return will b all the array..
}