Php采集远程图片到本地
作者:admin 日期:2009-09-13
<?php
require_once('httpdown.class.php');
$img = "http://www.baidu.com/img/baidu_logo.gif";
//获取一个远程图片
$htd = new HttpDown();
$htd->OpenUrl($img);
$itype = $htd->GetHead("content-type");
if($itype=="image/gif")
{
$itype = ".gif";
}
else if($itype=="image/png")
{
$itype = ".png";
}
else if($itype=="image/wbmp")
{
$itype = ".bmp";
}
else
{
$itype = ".jpg";
}
$rndtrueName = "qerwerewre".$itype;
$ok = $htd->SaveToBin($rndtrueName);
$htd->Close();
?>
呵呵,采集类就不公开了,提供会员下载!
下一篇: php转换编码的mb_convert_encoding函数
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: php
相关日志:
广告位