Home >Backend Development >PHP Tutorial >php curl 获取信息不完整

php curl 获取信息不完整

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:43:591160browse

用 php curl 获取页面数据,页面有1000条数据,有时候可以获得1000条,有时候获得500条,600条,
有时候会不完整,求解,这是为啥

$ch = curl_init();            curl_setopt ($ch, CURLOPT_URL, $url);           curl_setopt ($ch, CURLOPT_COOKIEJAR, "c:\cookie.txt");       curl_setopt ($ch, CURLOPT_HEADER, 1);       curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);       curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);	   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));       curl_setopt ($ch, CURLOPT_TIMEOUT, 120);       $result = curl_exec ($ch);       curl_close($ch);     echo $result;


回复讨论(解决方案)

curl_setopt ($ch, CURLOPT_TIMEOUT, 120);

???300看看。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn