-4

我正在尝试找到将图像从另一个站点上传到我的图像文件夹的最简单方法。我不需要重命名或重新调整大小,或者在页面上找到它,我只想采用http://www.mlbtraderumors.com/images/logo.png之类的完整路径并将 logo.png 上传到我的图像目录。

4

2 回答 2

1

那是你想要达到的吗?

$source = file_get_contents("http://www.mlbtraderumors.com/images/logo.png");
file_put_contents("images/logo.png", $source);

它会将图像复制到您的图像文件夹..

于 2013-07-31T17:14:45.613 回答
0

也许这会有所帮助:

首先,使用 imagecreatefromjpeg($url): http ://us2.php.net/manual/en/functio...tefromjpeg.php

然后,使用 imagecreatetruecolor(): http ://us2.php.net/manual/en/functio...etruecolor.php

然后,使用 imagecopyresampled(): http ://us2.php.net/manual/en/functio...yresampled.php

最后,使用 imagejpeg(): http ://us2.php.net/manual/en/function.imagejpeg.php

于 2013-07-31T17:15:09.950 回答