我沒有得到捲曲輸出有效的URL, 樣品$網址空輸出= http://linkedin.com/pub/4/b29/8a0PHP CURL - 沒有錯誤
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$referer = WebCrawl::getRandomURL();
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
$body = curl_exec($ch);
$error_no = curl_errno($ch);
你實際上是在一些點輸出'$ error_no'? –
它被添加到檢查任何錯誤 – Muzaffer
是的,但你真的*輸出*結果的地方?使用上面的代碼,您將看不到錯誤 –