i'm totally at lost here..really need help..please guysss~~
actually my problem still not resolved...
the workaround didnt work for me..
i change the array structure instead..i do array_merge and compare each element..so now i got only one multidimensional array...but unfortunately i got
Fatal error: Maximum execution time of 30 seconds exceeded in d:\webserv\www\stage2\testing_combine2.php on line 142
i know it must be the loop..or the searching process...
my array looks like:
$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');
each of these from within different loops in order to populate g_res,y_res,a_res...
e.g.
$g_res[1]= array('www.petronas.com.my','the desc of the result','Google');
so..i'm comparing the URL part..$g_URL,$y_URL,$a_URL
here's the pseudo...
1st search_values:
if found same url
put in other array[search_values]
unset(current_array) //delete the current element
keep searching if count($res)>0 //there's still result to be searched..
if found same again..
array_push(array[search_values],'Yahoo')
(at the end of the process..the results with the same URL will be deleted..leaving smaller number of result..
if same URL not found
call the function again with next search_values..
cont to 2ndURL:.....
$res = array_merge($g_res, $y_res, $a_res);
$counter = count($res);
$i=0;
$x=0;
filter($res,$x,$i,$counter);
function filter($res,$x,$i,$counter){
$search_values=$res[$x][0];
while($i<$counter){
if(strpos($res[$i][0], $search_values)!==FALSE){
//$new_array[$search_values]=$res[$i];
//unset($res[$i]);
$res = array_values($res);
$counter--;
if(($counter == 0) == FALSE ){
filter($res, $x,$i++,$counter); //same $search_values
}
/*
else{
$x++;
$i=0;
$counter = count($res);
filter($res,$x,$i,$counter); //new $search_values
}*/
}
}
echo count($res);
}
help me here please...my presentation is no more than 2 weeks time..huuwaa~~~ 😕 at the same time :queasy: