php curl 下载图片到本地
php curl 下载图片到本地 [代码片段(13行)]
<?php
//获取空间头像图片
$url = "http://qlogo2.store.qq.com/qzone/393183837/393183837/50";
$curl = curl_init($url);
$filename = date("Ymdhis").".jpg";
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
$imageData = curl_exec($curl);
curl_close($curl);
$tp = @fopen($filename, ‘a’);
fwrite($tp, $imageData);
fclose($tp);
?>
//该片段来自于http://outofmemory.cn
- 上一篇:php 登录代码
- 下一篇:php 自己写的判断手机登陆
精彩图集
精彩文章






