title: How to get thumbnail of youtube video from url using php and API
body: <p>Below code, I got title and description but I want image as well as
   how to get the main image of video from JSON data.</p>
  
  <pre><code>$videoid = 'cMC_PtgKDJE';
  $apikey = 'xyzxyzxyz';  //My API key
  
  $json = file_get_contents('https://www.googleapis.com/youtube/v3/videos?id='.$videoid.'&amp;key='.$apikey.'&amp;part=snippet');
  $ytdata = json_decode($json);
  print_r($ytdata);
  echo '&lt;h1&gt;Title: ' . $ytdata-&gt;items[0]-&gt;snippet-&gt;title . '&lt;/h1&gt;';
  echo 'Description: ' . $ytdata-&gt;items[0]-&gt;snippet-&gt;description;
  </code></pre>