1
我已經編寫了這段代碼來獲取來自谷歌的所有數據,但它返回空白。代碼是CURL返回空白頁
$page = "http://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$contents = curl_exec ($ch);
curl_close ($ch);
echo $contents;
任何人都可以找到這個代碼有什麼問題嗎? 我檢查php信息我的捲曲已啓用。
試試[http://php.net/ manual/en/function.curl-error.php](http://php.net/manual/en/function.curl-error.php) – machineaddict 2013-04-10 13:26:25
你有一個*** PHP解析錯誤:語法錯誤,意外結束文件,期待在你的代碼中的***。修復它顯示它工作正常:http://codepad.viper-7.com/9Yxr7h – 2013-04-10 13:29:09
嘗試[PHP CURL無返回](http://stackoverflow.com/questions/6324819/php-curl-returns-nothing) – 2013-04-10 13:29:56