PHP Parse error: syntax error, unexpected T_RETURN in /root/script.php on line 60
http://gyazo.com/627....png?1361837652
function get_google($kw, $res=10, $geo='US') {
$urls = array();
if ($geo == '') $geo = 'US';
$url = 'http://www.google.com/search?hl=en&as_qdr=all&gl='.$geo.'&q='.urlencode($kw).'&num='.$res;
try {
$html = curl_fetch($url);
$dom = new DOMDocument();
@$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
if ($href->getAttribute('class') == 'l') {
$link = explode('?', $href->getAttribute('href'));
$urls[] = $link[0];
}
}
} catch (Exception $e) {}
return $urls;
}
Would like some help if someone could! Thanks!

New Topic/Question
Reply



MultiQuote




|