PHP image save using curl giving garbage values -
i trying save images using php code using curl.
function scaleimageandsaveit($appname,$imageurl) { $format=time(); print_r($format); //$strf=strftime($format); $imagelocnname = $appname . "_" . $format ; $ch = curl_init($imageurl); print_r($imageurl); $fp = fopen($imagelocnname, 'wb'); curl_setopt($ch, curlopt_file, $fp); curl_setopt($ch, curlopt_header, 0); //exit; curl_exec($ch); curl_close($ch); fclose($fp); }
when running in browser giving garbage values on screen , not saving image also.
how save image , garbage values.
Comments
Post a Comment