聘我网

新概念招聘3.0

如何用PHP下载图片?

vote up0vote downstar

只下载过文本,图片怎么办?

 

1 个答复

vote up0vote downcheck
$fp = fopen('logo.png', 'w');
fwrite($fp, file_get_contents('http://www.google.cn/images/nav_logo7.png'));
fclose($fp);

或者

$content = file_get_contents('http://sstatic.net/so/img/logo.png')
file_put_contents('logo.png', $content);

跟读文本是一样的:)

链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.