2011-07-31 46 views
-2

我可以使這項工作..有沒有一種方法可以像這樣用PHP查詢Google?

if ($content = file_get_contents("http://www.somerandomwebsite.com")) { 
echo $content; 
} 

但..是有辦法做到這一點?

if ($content = file_get_contents("site:somerandomwebsite.com")) { 
echo "Still Indexed!"; 
} 
else { 
echo "Google does not love you anymore"; 
} 
+0

那是什麼呢?你不是指'http://google.com/?q=「一些+查詢+ - 站點:somrandomwebsite.com」'? – bluefoot

+2

wget是你的朋友 – Bytemain

+0

我不認爲你可以通過file_get_contents獲取google結果頁面。嘗試curl()代替。 –

回答

相關問題