king_421 发表于 2012-10-8 10:04:46

关于新浪微博头像图片地址

图片的地址是这样的:http://tp2.sinaimg.cn/1893053417/180/1,我现在想把这个图片处理存储到本地服务器上,可以实现吗?

jeongee 发表于 2012-10-8 10:38:17

能{:1_1:}{:1_1:}

king_421 发表于 2012-10-8 11:00:12

jeongee 发表于 2012-10-8 10:38 static/image/common/back.gif


那具体怎么实现的呢?Tks。

king_421 发表于 2012-10-9 14:25:23

解决了,可以的哈

$this->load->helper('file');
$data = file_get_contents("http://tp2.sinaimg.cn/2070296533/180/5640410092/1");
if ( ! write_file('images/people/weibo2.png', $data))
{
          echo 'Unable to write the file';
}
else
{
          echo 'File written!';
}
页: [1]
查看完整版本: 关于新浪微博头像图片地址