Heya!
I got a problem. :bemused:
I keep getting this error:
Warning: file(http://www.google.com/search?q=cap golf): failed to open stream: HTTP request failed! J in googlebattle.php on line 33
Warning: implode(): Bad arguments. in googlebattle.php on line 33
Function:
function linkcheck($path, $engine) {
global $results;
global $total;
if(!file_exists($path)) {
$data = strtolower(strip_tags(implode(",",file($path))));
$data = substr($data, strpos($data, "of about")+9, strlen($data));
$data = substr($data, 0, strpos($data, " "));
if(eregi("[[:alpha:]]", $data)) {
$results[$engine] = array('0', $path);
} else {
$results[$engine] = array($data, $path);
$total+=str_replace(',', '', $data);
}
} else {
$results[$engine] = array('n/a', $path);
}
}
What i am trying to get is to search how many pages are out there if searched in google for a particular keyword(s). It works perfectly if i enter a single keyword (ex. yahoo) but when i try to use two words (cap golf) it gives me the error above.
this is my linkcheck:
if($domain) {
$results = array();
linkcheck("http://www.google.com/search?q=".$domain."", 'google');
}
I would really appreciate if someone with great knowledge about php can help me.
Thanks in advance!