Home > Backend Development > PHP Tutorial > 怎么用PHP将网络下的文件上载到PHP文件所在服务器下

怎么用PHP将网络下的文件上载到PHP文件所在服务器下

WBOY
Release: 2016-06-13 13:05:50
Original
784 people have browsed it

如何用PHP将网络上的文件下载到PHP文件所在服务器上?
比如PHP文件A在服务器A上,服务器B上有一张图片A,其地址为http://www.xxx.xx/images/xx.jpg。
通过什么函数才能在PHP文件A执行之后将图片A下载到服务器A上?
顺便求个中文的比较全的PHP函数手册。

------解决方案--------------------

PHP code

$content = file_get_contents("http://www.xxx.xx/images/xx.jpg");
file_put_contents("img.jpg",$content); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template