function imagefromURL($image,$rename)
{
	$ch = curl_init($image);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
	$rawdata=curl_exec ($ch);
	curl_close ($ch);
	$fp = fopen("$rename",'w');
	fwrite($fp, $rawdata); 
	fclose($fp);
}

语法:

$url = "http://www.junphp.com/images/logo.png";
$rename = "junphp.png";
imagefromURL($url,$rename);


相关评论(0)
您是不是忘了说点什么?

友情提示:垃圾评论一律封号...

还没有评论,快来抢沙发吧!