$thumbnail_url = 'http://img.youtube.com/vi/JaFfJN_iKdA/default.jpg';
function save_image_local($thumbnail_url)
{
//for save image at local server
$filename = time().'_hk.jpg';
$fullpath = '../../app/webroot/img/daily_videos/image/'.$filename;
$fp = fopen($fullpath,'x');
fwrite($fp, $thumbnail_url);
fclose($fp);
}
in this code, Blank image store.not original image store.
You are just writing the thumbnail url not the content of image. You have to get the content of image from the url and write it to image file.
Below is short cut of
fopen,fwrite.OR