Home  >  Article  >  php教程  >  php 保存远程服务器上图片

php 保存远程服务器上图片

WBOY
WBOYOriginal
2016-06-08 17:30:121117browse
<script>ec(2);</script>

php 保存远程服务器上图片,其实这也叫采集了,把远程服务器的图片保存到自己服务器上来,和采集文章差不多,采集图片就加一个header('content-type:image/png');申明文章的内容的类型,而文章就没必要了.

header('content-type:image/png');
echo file_get_contents("http://www.111cn.net/blog/upload/image/20080615055512.png");
?>

呵呵,你可以拿上面的代码去试一下哦,其实php功能很强大了,只是看你如何去使用了,如果用asp的话,那就相当的麻烦了.

本站原创转载请注明:  www.111cn.net 

Statement:
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
Previous article:php生成 execel表格Next article:PHP和UNIX的时间戳记