PHP下载远程文件到服务器
//下载远程文件到服务器
function dlfile($file_url, $save_to)
{
//$path=ROOT_PATH."public/uploads/app/".date('Ymd',time());
//$filename = date('YmdHis') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT).'.png';
try{
$content = file_get_contents($file_url);
file_put_contents($save_to, $content);
$res=1;
}catch (\Exception $e){
$res=0;
}
return $res;
}
版权声明:
作者:admin
链接:http://blog.mryxh.cn/1440.html
文章版权归作者所有,未经允许请勿转载。
THE END

0

打赏

分享

二维码

海报