我需要从外部链接下载图像并将其存储到我的本地服务器中。
现在我写了 cron 函数完成了这项工作.还有ini_set('max_execution_time', 0);
I used curl method for download the image from external link. And, fwrite was used
to save the image into my local server . I need to know which method is faster ?
Like (fileputcontents,fwrite,copy)
你可以执行以下操作:
$from_url = "yoursiteurl";
$path = "pathtofolder";
$file_name = "latest.zip";
file_put_contents($path.$file_name, file_get_contents($from_url.$file_name));
这是服务器到服务器传输的最快方法。