OK, I have been struggling for about 2 days on this. I can get an image from youtube like this,
$filename = $video_id . '.jpg';
$youtube_thumb_url = "https://img.youtube.com/vi/". $video_id . "/maxresdefault.jpg";
$imagedata = file_get_contents($youtube_thumb_url) ;
this is where I am stuck, how do I save this back to a .jpg file? I tried this,
$imagedata->move('uploads', $filename );
But that did not work, because $imagedata is a string.
I thought of trying to convert $imagedata, but I cant figure out what the format of is.
Help Please. Bill