码迷,mamicode.com
首页 > 其他好文 > 详细

采集课件等文档

时间:2017-08-13 01:05:15      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:top   exec   cti   ring   cat   get   web   curl   timeout   

function getwebcontent($url){
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$contents = trim(curl_exec($ch));
curl_close($ch);
return $contents;
}
$string = getwebcontent(‘http://202.97.3.101/IXC05b1e26cc036d03c3638fcfe274b31df_223.98.44.98/jast/kj/201707/2017%E5%B9%B4%E7%A7%8B%E5%86%80%E6%95%99%E7%89%88%E4%B8%83%E5%B9%B4%E7%BA%A7%E4%B8%8A2.2%E7%82%B9%E5%92%8C%E7%BA%BFppt%E8%AF%BE%E4%BB%B6.rar‘);
file_put_contents("./load/kejian.rar", $string);

路径名必须存在

 

采集课件等文档

标签:top   exec   cti   ring   cat   get   web   curl   timeout   

原文地址:http://www.cnblogs.com/xtmp/p/7352050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!