标签:open fwrite bsp image 文件 code exe 名称 图片
function saveImage($path) { if(!preg_match(‘/\/([^\/]+\.[a-z]{3,4})$/i‘,$path,$matches)) die(‘Use image please‘); $image_name = strToLower($matches[1]); $ch = curl_init ($path); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); $img = curl_exec ($ch); curl_close ($ch); $fp = fopen($image_name,‘w‘);//保存的文件名称用的是链接里面的名称 fwrite($fp, $img); fclose($fp); } saveImage(‘http://www.jb51.net/images/logo.gif‘);
标签:open fwrite bsp image 文件 code exe 名称 图片
原文地址:http://www.cnblogs.com/zonglonglong/p/7323317.html