保存图像
I have a picture url like this http://www.address.com/image.jpg
I want do dynamically save this image on my server
How can i achieve this using php
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
file_get_contents()
并使用file_put_contents()
< 保存它/a>.例如:您可能还需要查看 cURL 来获取图像;它应该比
file_get_contents()
表现更好(除非您使用--with-curlwrappers
编译curl)You can get it using
file_get_contents()
and saving it usingfile_put_contents()
. Something like:You also might want look into cURL to fetch the image; it should perform better than
file_get_contents()
(unless you compile curl with--with-curlwrappers
)