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);
上一篇:
php检测 URL 是否有效
下一篇:
php删除文件夹内容
友情提示:垃圾评论一律封号...