curl()比file_get_contents()快几倍.
function curl_file_get_contents($durl)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $durl);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$r = curl_exec($ch);
curl_close($ch);
return $r;
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容