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.

image link

screenshot of garbage values


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

c# - MSDN OneNote Api: Navigate to never before opened page without opening a OneNote Application Window -