首页 > 代码库 > 采集课件等文档

采集课件等文档

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);

路径名必须存在

 

采集课件等文档