Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从其他服务器下载图像_Php - Fatal编程技术网

Php 从其他服务器下载图像

Php 从其他服务器下载图像,php,Php,可能重复: 我想从另一台服务器下载图像。我有他们的http路径。他们是一种方式,我可以下载的形象,右键点击它,并保存这个形象。但我想用php编码实现同样的功能。 是否有任何方法或脚本对该操作有帮助,或有任何想法对该操作有用。php至少有一个简单函数用于此目的: $filecontent = file_get_contents($imageurl); 如果要下载并保存图像,请执行以下操作: file_put_contents('/path/to/save/image', file_get_co

可能重复:

我想从另一台服务器下载图像。我有他们的http路径。他们是一种方式,我可以下载的形象,右键点击它,并保存这个形象。但我想用php编码实现同样的功能。
是否有任何方法或脚本对该操作有帮助,或有任何想法对该操作有用。

php至少有一个简单函数用于此目的:

$filecontent = file_get_contents($imageurl);

如果要下载并保存图像,请执行以下操作:

file_put_contents('/path/to/save/image', file_get_contents($imageurl));