在PHP中下载文件的最佳方法 [英] Best way to download a file in PHP

查看:77
本文介绍了在PHP中下载文件的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种方法是从PHP的另一个域下载文件的最佳方法? 即一个zip文件.

Which would be the best way to download a file from another domain in PHP? i.e. A zip file.

推荐答案

最简单的方法是 file_get_contents() ,更高级的方法是使用 cURL .您可以使用 file_put_contents() 将数据存储到硬盘中.

The easiest one is file_get_contents(), a more advanced way would be with cURL for example. You can store the data to your harddrive with file_put_contents().

这篇关于在PHP中下载文件的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆